bugGNU nano - Bugs: bug #49817, partial trailing selection gets...

 
 

bug #49817: partial trailing selection gets lost after spell check

Submitted by:  Mike Frysinger <vapier>
Submitted on:  Fri 09 Dec 2016 07:28:14 PM UTC  
 
Severity: 3 - NormalStatus: 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 11 Dec 2016 09:06:23 AM UTC, comment #2:

Fixed in git, 13ec5d8c. Thanks for reporting.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 10 Dec 2016 10:56:55 AM UTC, comment #1:

Wow. I've done quite a few backward and forward selections, but never noticed this one. Bug is old too, since at least nano-2.2.1.

When using --ignore, nano adds a "magic linefeed" at the end of the spell-checked region. It does strip this linefeed again, but only /after/ it has restored the x position, which means it always "restores" the x position to zero (when not using --nonewlines). It should strip the linefeed /before/ restoring x. Attached patch does this and fixes the problem for me.

(Here is a condensed reproduction recipe: run: src/nano -I -s 'aspell -x -c -l en' +7,22 README --
then type: xxx M-A M-\ ^T X.)

(file #39192)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 09 Dec 2016 07:28:14 PM UTC, original submission:

testing with commit a4044a7e5d8686a7aea8af70e62406aa3ec483b7

(1) run:
$ nano -I -s 'aspell -x -c'
(2) add these two lines:
some line
abadwordasdfasdfasdf
(3) place your cursor at the end of the 2nd line
(4) ctrl+^ to start a mark
(5) move the cursor to the start of the file (byte 0)
(6) ctrl+t to launch speller
(7) hit 'x' to quit aspell
(8) see that the 2nd line is no longer highlighted

seems like the selection restore logic does it to the start of lines and so drops all of the last line

Mike Frysinger <vapier>
Project Member

 

(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 (Updated the item)
  • -unavailable- added by vapier (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
    Tue 13 Dec 2016 11:50:13 AM UTCbensOpen/ClosedOpen=>Closed
    Sun 11 Dec 2016 09:06:23 AM UTCbensStatusIn Progress=>Fixed
    Sat 10 Dec 2016 10:56:55 AM UTCbensAttached File-=>Added strip-magic-linefeed-first.patch, #39192
      StatusNone=>In Progress
      Assigned toNone=>bens

    Back to the top


    Powered by Savane 3.1-cleanup1