Sublime Forum

[BUG] Toggle Block Comment + Undo colours the file gray

#1

Open a file written in a language that supports block comments, such as C or XML. (Or create a new one and enter several lines of code or just rubbish.) Find two consecutive non-comment lines. Select the text starting with any point in the first line and ending at any point in the second line and press Ctrl+Shift+Slash or choose Edit → Comment → Toggle Comment (block) from the menu. Now press Ctrl+Z or choose Edit → Undo. What happens is that the part of the file starting with the ending point of the selection and ending at the end of the nearest block comment (or, if there is none, the end of the file) is coloured as if it was commented out, which it is not.

The colour can be fixed by re-opening the file or deleting (and re-adding if needed) the line break that was within the selection. Also, the bug does not seem to be there if multiple line breaks are present in the selection when it is being commented out.

P. S. I am using today’s beta.

0 Likes

#2

I’ve noticed this bug for a while but could never figure out how to reproduce.
Glad someone else did, 'cause this one’s annoying.

0 Likes

#3

Thanks for the detailed bug report. This isn’t fixed in 20100528, but it’s on the top of the list for the next beta.

0 Likes