Author Topic: Mini Find replace...  (Read 4047 times)

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Mini Find replace...
« on: November 07, 2017, 08:15:46 pm »
22.0.0.9

Mini Find replace, on a selection, clicking R does not always replace a string...

see attached images of replacing "RDP_" with "FDMI_"

clicking R replaces the current match and goes to the next match...

but you can see that match instances 1 and 4 have not been replaced
(I have to click R several more times for those two instances to replace).



« Last Edit: November 07, 2017, 08:20:50 pm by joecar »

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #1 on: November 07, 2017, 08:25:56 pm »
Seems like the first and last instances do not get replaced...

so then I keep clicking R and eventually only one instance (of the two instances) remains un-replaced...
so then I persist and sometimes it replaces and sometimes it doesn't (so I have to manually replace it).

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Mini Find replace...
« Reply #2 on: November 07, 2017, 08:42:24 pm »
Where is the cursor located when you started? With Mini-Find, the R button will replace the current match, and move to next occurrence.  From the first screenshot, I see all the matches in the selection highlighted, but I don't see a highlight for the current match.  If there isn't a current match to replace, then it searches for the next occurrence.  From the screenshots and what you are describing, I believe it is working as designed.

UPDATE:
Okay, I think I did just find something odd with wrapping in a selection in testing.  Are you seeing any messages on the status line about wrapping or search past the starting point?

« Last Edit: November 07, 2017, 08:53:36 pm by Lee »

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #3 on: November 08, 2017, 01:48:08 am »
Where is the cursor located when you started?
I just finished highlighting that slab of code, so the cursor is at the end of that slab... and I clicked the Find button which brought up the Mini Find bar, then I clicked the down-arrow-pair to show the replace textbox/options... so the cursor was somewhere inside the Mini Find bar, I had not yet clicked the R button.

Quote
With Mini-Find, the R button will replace the current match, and move to next occurrence.  From the first screenshot, I see all the matches in the selection highlighted, but I don't see a highlight for the current match.
In the first screenshot  I had not yet clicked the R button (cursor was somewhere in the Mini Find bar).

Quote
If there isn't a current match to replace, then it searches for the next occurrence.  From the screenshots and what you are describing, I believe it is working as designed.
On each click of the R button, I see that it replaces the current instance and moves to the next instance... except that the first and last instances in the selected slab are not replaced.

Quote
UPDATE:
Okay, I think I did just find something odd with wrapping in a selection in testing.  Are you seeing any messages on the status line about wrapping or search past the starting point?
Some message does flash very briefly on the status line, but it's too quick for me to read.

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #4 on: November 08, 2017, 02:16:26 am »
Now I am seeing it miss some instances (not just the first/last)...

see attached screen video capture (captured using MS Expression, plays in Windows Media Player)... pay attention to R button clicks.
« Last Edit: November 08, 2017, 02:18:08 am by joecar »

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #5 on: November 08, 2017, 02:20:05 am »
And it only seems to happen when doing replacement in Current Selection.

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #6 on: November 08, 2017, 02:25:03 am »
Also, sometimes, in the Mini Find bar, the cursor appears as the text cursor (vertical I beam) rather than the arrow-pointer.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Mini Find replace...
« Reply #7 on: November 08, 2017, 02:16:13 pm »
Thanks for the video, there is something very very wrong going on there. I am not able to reproduce the issue yet, what other search/replace options do you have enabled? And what regular expression syntax?  Does it do something different if you toggle off the regular expression syntax? 

Something I noticed in the video where the current match highlight disappears just before the replace, like almost on a timer.  Do you have any sort of additional context highlighting enabled or running a custom highlighting macro on a timer?

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #8 on: November 08, 2017, 06:30:34 pm »
see attached image for search options:


joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #9 on: November 08, 2017, 06:32:25 pm »
Regular Expression (Perl).

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #10 on: November 08, 2017, 06:34:49 pm »
Behavior is the same with all regex options, and with regex disabled.

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #11 on: November 08, 2017, 06:37:53 pm »
...
Do you have any sort of additional context highlighting enabled...
Not that I'm aware of... how would I check this...?

Quote
or running a custom highlighting macro on a timer?
Not that I'm aware of.

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #12 on: November 08, 2017, 07:22:30 pm »
Also, sometimes, in the Mini Find bar, the cursor appears as the text cursor (vertical I beam) rather than the arrow-pointer.
I notice this happens, in general, when  you move the cursor to the Mini Find bar (i.e. when Mini Find bar is already visible)... (maybe can be described as cursor does not realize context has changed from text to pointing).

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Mini Find replace...
« Reply #13 on: November 08, 2017, 07:32:02 pm »
I think I may know what's going on.  There is a timer event happening and it is causing the Mini-Find to clear the current match.  The Mini-Find has it's own timer callback that tracks changes in the cursor and selection, and it's just not handling things correctly.  I am working on a hotfix the issue.

joecar

  • Senior Community Member
  • Posts: 323
  • Hero Points: 9
  • engineer/gearhead
Re: Mini Find replace...
« Reply #14 on: November 08, 2017, 11:02:59 pm »
Thanks.

BTW:
a. this seems to happen only with Current Selection context.
b. this works correctly in other contexts (Current Buffer, Current Procedure, All Buffers, Project, Workspace).