Author Topic: Command line search/replace wrap behaving differently  (Read 768 times)

Dennis

  • Senior Community Member
  • Posts: 3992
  • Hero Points: 520
Command line search/replace wrap behaving differently
« on: April 22, 2024, 01:43:32 PM »
I'm seeing what I think is a slightly different behavior with command line search and replace and wrapping to the top of the buffer (in v28, not new to 28.0.2):

Suppose you have this file:
Code: [Select]
HEARTS
HEARTS
HEARTS
HEARTS
HEARTS

And you want to replace it with clubs and your cursor is on line 3.

Code: [Select]
c/HEARTS/CLUBS/
You will be prompted for the three replacements, and then prompted about wrapping to the top.  "End of file reached.  Continue searching from the top?"  After selecting "Yes", I just get a message saying "Command cancelled. Replaced 3 occurrences".  It used to correctly continue searching and replacing from the top.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6937
  • Hero Points: 531
Re: Command line search/replace wrap behaving differently
« Reply #1 on: April 22, 2024, 05:44:44 PM »
Reproduced. We will look into this.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6937
  • Hero Points: 531
Re: Command line search/replace wrap behaving differently
« Reply #2 on: April 24, 2024, 02:13:09 PM »
This has been broken for many years

A hot fix is available for this.

Download the hot fix here:

https://www.slickedit.com/hotfixes

Then load the hot fix: Help>Product Updates>Load Hot Fix...

Dennis

  • Senior Community Member
  • Posts: 3992
  • Hero Points: 520
Re: Command line search/replace wrap behaving differently
« Reply #3 on: April 24, 2024, 08:20:25 PM »
Thanks.  BTW, the hotfix page has a small typo (28.0.0.2).

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6937
  • Hero Points: 531
Re: Command line search/replace wrap behaving differently
« Reply #4 on: April 24, 2024, 08:23:07 PM »
Fixed typo

Dennis

  • Senior Community Member
  • Posts: 3992
  • Hero Points: 520
Re: Command line search/replace wrap behaving differently
« Reply #5 on: April 24, 2024, 08:24:07 PM »
That...was...FAST!

Dennis

  • Senior Community Member
  • Posts: 3992
  • Hero Points: 520
Re: Command line search/replace wrap behaving differently
« Reply #6 on: April 24, 2024, 11:07:41 PM »
Tried out the hot fix.  Don't really like the command line prompting instead of the message box.  I have a somewhat simpler fix.  Patch attached.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6937
  • Hero Points: 531
Re: Command line search/replace wrap behaving differently
« Reply #7 on: April 25, 2024, 12:17:13 AM »
Your fix fails sometimes. I can't always get it to fail but sometimes it fails. I get it to fail more often when I use the mouse but I know I got it to fail once using the keyboard.

I figured that since we are already prompting in the message line, might as well keep prompting in the message line. I could add an option to get_event() to avoid bailing when focus changes but that would take a new installer.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6937
  • Hero Points: 531
Re: Command line search/replace wrap behaving differently
« Reply #8 on: April 26, 2024, 01:09:51 PM »
get_event() already had an option to ignore focus events. I just added that. Created a hot fix 7