Sublime Forum

Bug report: Copy-and-paste copies document type

#1

Copy-and-paste copies the document type from one document to another. Is it meant to do that?

Steps to reproduce the problem in 20091118:

  1. Make a new page with ctrl-n.
  2. Note that the document type in the status bar is Plain Text.
  3. Change that document type to Python.
  4. Type this Python text: “#hello”.
  5. ctrl-a, ctrl-c
  6. Make another page with crtl-n.
  7. Note that the document type of the new page is Plain Text.
  8. ctrl-v
  9. Note that the document type has changed to Python and that the “#hello” has Python syntax highlighting applied to it.
  10. Click on the document type in the status bar.
  11. Note that there is a check mark next to Plain Text – which disagrees with what is displayed in #9.

An additional weird thing is that this new page uses my Plain Text tab-to-spaces setting instead of my Python one.

0 Likes

#2

Yes, it is. Copying text from an existing buffer into a new buffer will set the syntax highlighting of the new buffer, this is almost always what you want.

0 Likes

#3

Fair enough, but it seems to be doing an incomplete job of applying the new document type.

Note the inconsistencies (circled) in the following screen shot.

http://www.imagechicken.com/uploads/1259033117066409100.png

Note the tab character that appears when I press the tab key. That shouldn’t be there because my Python mode uses spaces instead of tabs.

http://www.imagechicken.com/uploads/1259033164098300500.png

0 Likes

#4

Thanks for the report - I’ll try to get this fixed for the next beta

0 Likes