bugGNU nano - Bugs: bug #50126, Replace no longer moves if you...

 
 

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

bug #50126: Replace no longer moves if you choose not to replace an instance

Submitter:  David Lawrence Ramsey <dolorous>
Submitted:  Mon 23 Jan 2017 01:38:38 PM UTC
   
 
Severity:  5 - Blocker Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Thu 26 Jan 2017 04:49:14 PM UTC, comment #6: 

And closing, because unreleased.

Benno Schulenberg <bens>
Group administrator
Thu 26 Jan 2017 04:46:51 PM UTC, comment #5: 

Fixed in git, ef7a7c53.

Benno Schulenberg <bens>
Group administrator
Wed 25 Jan 2017 07:07:00 PM UTC, comment #4: 

It seems to work fine so far.  Thanks.

David Lawrence Ramsey <dolorous>
Group Member
Wed 25 Jan 2017 10:45:34 AM UTC, comment #3: 

Okay, this was hard.  Attached patch fixes the problem for me.

The thing is... I don't understand myself any more why this logic works.  :|  It would seem that it would skip a match too many when replacing backwards -- but it doesn't.  I can't find anything that goes wrong.

Patch is against current git, 3534d8ff.

(file #39558)

Benno Schulenberg <bens>
Group administrator
Mon 23 Jan 2017 02:14:50 PM UTC, comment #2: 

Oof!  Serious badness.  Thanks for reporting.

Benno Schulenberg <bens>
Group administrator
Mon 23 Jan 2017 01:53:39 PM UTC, comment #1: 

Additionally, in step 2, if you press Meta-B at the "Search (to replace):" prompt to toggle backwards replacing just before typing "123", the same problem occurs.  So it happens with both backward and forward replace.

David Lawrence Ramsey <dolorous>
Group Member
Mon 23 Jan 2017 01:38:38 PM UTC, original submission:  

In current git, there's a problem when trying to do a replace of a string.  It can be reproduced as follows:

1. Start nano with the --ignore option, and open NEWS with it.

2. Press Ctrl-W followed by Ctrl-R to get the "Search (to replace):" prompt, and type "was" there.

3. Press Enter to get the "Replace with:" prompt, and type "123" there.

4. Press Enter, and the replace loop should start.  At the "Replace this instance?" prompt for the first instance of "was", press "N" to not replace that instance.

5. nano will not move from that instance, and will instead prompt again on the same instance.  (If you reply "Y" to replace the instance, or "A" to replace all instances, nano will move from that instance normally.)

This seems to have been broken by commit c88d7ce530aaac446baae143a2a7e7e29b78bae1, as reverting that commit makes replace work as expected.

David Lawrence Ramsey <dolorous>
Group Member

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by dolorous (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-01-26 bens Open/ClosedOpen Closed
    2017-01-26 bens StatusIn Progress Fixed
    2017-01-25 bens Attached File- Added 0001-replacing-ignore-the-first-match-when-the-user-said-.patch, #39558
        StatusNone In Progress
    2017-01-23 bens Severity3 - Normal 5 - Blocker
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code