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

 
 

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

Submitted by:  David Lawrence Ramsey <dolorous>
Submitted on:  Mon 23 Jan 2017 01:38:38 PM UTC  
 
Severity: 5 - BlockerStatus: 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.

 

(Jump to the original submission Jump to the original submission)

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

And closing, because unreleased.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 26 Jan 2017 04:46:51 PM UTC, comment #5:

Fixed in git, ef7a7c53.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 25 Jan 2017 07:07:00 PM UTC, comment #4:

It seems to work fine so far. Thanks.

David Lawrence Ramsey <dolorous>
Project Administrator
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>
Project AdministratorIn charge of this item.
Mon 23 Jan 2017 02:14:50 PM UTC, comment #2:

Oof! Serious badness. Thanks for reporting.

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

 

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

Attach File(s):
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 26 Jan 2017 04:49:14 PM UTCbensOpen/ClosedOpen=>Closed
    Thu 26 Jan 2017 04:46:51 PM UTCbensStatusIn Progress=>Fixed
    Wed 25 Jan 2017 10:45:34 AM UTCbensAttached File-=>Added 0001-replacing-ignore-the-first-match-when-the-user-said-.patch, #39558
      StatusNone=>In Progress
    Mon 23 Jan 2017 02:14:50 PM UTCbensSeverity3 - Normal=>5 - Blocker
      Assigned toNone=>bens

    Back to the top


    Powered by Savane 3.1-cleanup1