bugGNU nano - Bugs: bug #46794, deleting a character sometimes...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #46794: deleting a character sometimes fails to adjust the colours

Submitter:  Benno Schulenberg <bens>
Submitted:  Sat 02 Jan 2016 07:15:01 PM UTC
   
 
Severity:  4 - Important Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sun 03 Jan 2016 04:28:17 PM UTC, comment #3: 

Fixed in SVN, r5523.

Benno Schulenberg <bens>
Group administrator
Sun 03 Jan 2016 10:20:05 AM UTC, comment #2: 

Oh, remains to say: the bug is present in 2.5.0, but not in 2.4.3 or earlier.  So... when the fix reaches SVN, it is probably time for a release.

Benno Schulenberg <bens>
Group administrator
Sun 03 Jan 2016 10:14:03 AM UTC, comment #1: 

Attached patch fixes things.  The essence is that reset_multis() must be executed before doing anything with the display, because that routine determines whether the entire screen must be updated or whether updating just the current line is enough.

(file #35906)

Benno Schulenberg <bens>
Group administrator
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.)

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-01-14 bens Open/ClosedOpen Closed
    2016-01-03 bens Severity5 - Blocker 4 - Important
        StatusIn Progress Fixed
    2016-01-03 bens Attached File- Added update-only-after-reset.patch, #35906
        Summarydeleting a character sometimes does not adjust the colours deleting a character sometimes fails to adjust the colours

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code