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

 
 

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

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

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Fixed in SVN, r5523.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 14 Jan 2016 04:38:37 PM UTCbensOpen/ClosedOpen=>Closed
    Sun 03 Jan 2016 04:28:17 PM UTCbensSeverity5 - Blocker=>4 - Important
      StatusIn Progress=>Fixed
    Sun 03 Jan 2016 10:14:03 AM UTCbensAttached 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.1-cleanup1