Sat 02 Jan 2016 07:15:01 PM UTC, original submission:
Create a file called bad.c with the following three lines:
/* One. Two. */
that is BAD
/* Three. */
Then run 'src/nano +1,22 bad.c', and press:
<Left> followed by <Backspace> or <Delete>.
The line "that is BAD" is not recoloured as a comment. Which is bad, very bad, completely wrong.
The culprit seems to be the update_line() command at the end of do_deletion(). That line has no business there: this is text manipulation, not display handling. Removing it seems to make things work fine. Testing further...
(A strange thing is that if the <Left> is left out, things seem to work fine. But that is just the first time: when you retype the deleted character and then delete it again, the colours are no longer adjusted. This is because somehow, when nano is started, and nothing is typed yet, edit_refresh_needed is already TRUE. I don't understand why or where, but it means that for the very first keystroke, things will work okay.)
|