SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: joecar on November 07, 2017, 08:15:46 pm

Title: Mini Find replace...
Post by: joecar 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).



Title: Re: Mini Find replace...
Post by: joecar 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).
Title: Re: Mini Find replace...
Post by: Lee 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?

Title: Re: Mini Find replace...
Post by: joecar 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.
Title: Re: Mini Find replace...
Post by: joecar 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.
Title: Re: Mini Find replace...
Post by: joecar on November 08, 2017, 02:20:05 am
And it only seems to happen when doing replacement in Current Selection.
Title: Re: Mini Find replace...
Post by: joecar 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.
Title: Re: Mini Find replace...
Post by: Lee 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?
Title: Re: Mini Find replace...
Post by: joecar on November 08, 2017, 06:30:34 pm
see attached image for search options:

Title: Re: Mini Find replace...
Post by: joecar on November 08, 2017, 06:32:25 pm
Regular Expression (Perl).
Title: Re: Mini Find replace...
Post by: joecar on November 08, 2017, 06:34:49 pm
Behavior is the same with all regex options, and with regex disabled.
Title: Re: Mini Find replace...
Post by: joecar 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.
Title: Re: Mini Find replace...
Post by: joecar 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).
Title: Re: Mini Find replace...
Post by: Lee 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.
Title: Re: Mini Find replace...
Post by: joecar 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).
Title: Re: Mini Find replace...
Post by: Lee on November 09, 2017, 07:18:22 pm
Please try the latest hotfix, info here: https://community.slickedit.com/index.php/topic,6567.msg60543.html#msg60543

I've made a few changes to address problems with replace in selection, hopefully it will resolve your issues.
Title: Re: Mini Find replace...
Post by: joecar on November 09, 2017, 10:05:59 pm
No, it's doing the same thing, and now it reduces the selection down to the first line containing the match...

Title: Re: Mini Find replace...
Post by: joecar on November 09, 2017, 10:12:42 pm
See attached vid (running hotfix 10)...
Title: Re: Mini Find replace...
Post by: joecar on November 10, 2017, 12:40:52 am
How do I get back to hotfix 9...?

something odd is happening with hotfix 10 regarding references, attached pics...

there are 4 references to nv->login_retry_count in that function...

( BTW: image attached shows search with Current Procedure context, image shows it found instances outside current procedure )
Title: Re: Mini Find replace...
Post by: Lee on November 10, 2017, 03:27:33 pm
Apologies, yes the new hotfix was definitely not ready for prime-time and it was rushed out without enough testing.   There are still issues with Replace in Selection and you have discovered another issue with Find all <Current Procedure>, though I think this issue pre-dates the current hotfix.  There is a command unload-hotfix that will allow you to rollback loaded hotfixes.  I am not sure about a problem with References, it may be hotfix related or something localized with your tag file or config.  Try rolling back the hotfix to see.
Title: Re: Mini Find replace...
Post by: joecar on November 10, 2017, 04:21:14 pm
ah, unload-hotfix... ok, I'll roll back to prev hotfix.
Title: Re: Mini Find replace...
Post by: joecar on November 17, 2017, 09:38:47 pm
ok, original problem (topic of this thread) is fixed in hotfix 11.

thanks.