Author Topic: Two slick stacks from multi-file search & replace  (Read 4886 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Two slick stacks from multi-file search & replace
« on: August 10, 2016, 06:26:06 PM »
Two stacks, one right after the other.




The filename listed in the second stack has one instance of "Error()", and it was not replaced.

« Last Edit: August 10, 2016, 06:28:55 PM by jporkkahtc »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Two slick stacks from multi-file search & replace
« Reply #1 on: August 11, 2016, 12:09:09 AM »
Looked at the stacks. Can't tell exactly where the invalid number argument occurred (stack occurred in a C++ call). Arguments look reasonable.

Were you prompted whether to make a replacement before the Stack?

Are you able to reproduced this?

The second stack looks bogus (incomplete and incorrect...not sure why) and doesn't help.




jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Two slick stacks from multi-file search & replace
« Reply #2 on: August 11, 2016, 12:31:19 AM »
Yes it repros -- I did the opposite search and replace.
I did a Find->ReplaceInFiles and I hit ReplaceAll so I didn't get any prompting.




BTW, the SlickC debugger hangs when I try to single-step over line 1190 of mfsearch.e : _grep_file_list


Also, if I run the S&R with the SlickC debugger attached, the slick-stack is apparently swallowed by the debugger -- the replace operation aborts early, but I see no errors in Slick or the debugger.


jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Two slick stacks from multi-file search & replace
« Reply #3 on: August 11, 2016, 12:40:23 AM »
Well, I tried doing Replace instead of Replace all, and it doesn't repro when I step thru each replace operation one at a time.




But now, I've gotten into a case where the Find dialog won't open.


I type Ctrl+H, the buffer looses focus, but no find window.
Alt+Space usually is good for finding lost windows, but it doesn't help here.
Restarting Slickedit didn't help either.


Hm... retrying Ctrl+H many times and it finally comes back.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Two slick stacks from multi-file search & replace
« Reply #4 on: August 11, 2016, 01:05:47 AM »
According to the first stack, you pressed Alt+R and not Alt+A. Not that it makes a difference for me.

I haven't been able to reproduce this.

How picky is this for you? Do the options matter? Does it matter whether you do a replace on different files (maybe a small list of files)?

I'm trying this on a fairly large source tree.

If Ctrl+H won't display the find tool window, delete your vrestore.slk file.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Two slick stacks from multi-file search & replace
« Reply #5 on: August 11, 2016, 06:35:06 PM »
I made these macros (attached), when I run them alternately it gets the same stack each time.

When I S&R from A to B, I have to run the replace twice - the first time it fails before doing all the files.
The second time it completes.
This is very consistent.

Happens every time i do this search - but *only* when I have those five files loaded.

When those files are not loaded, the S&R typically fails to find any matches at all.

I copied these files to C:\Slick\Beta\2\data\FILE[1-5].txt

Seems to have the same behavior there.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Two slick stacks from multi-file search & replace
« Reply #6 on: August 11, 2016, 06:43:54 PM »
match-whole-word has a big impact.


Searching for "Error(" with match-whole-word will only match in buffers that are loaded.
If the file is only on disk, no match.


With a regex '\bError\('
Finding in files seems to work fine.


S&R using that regex works without error -- so it is something to do with whole-words.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Two slick stacks from multi-file search & replace
« Reply #7 on: August 11, 2016, 09:05:38 PM »
I'm able to reproduce the incorrect word matching. I can't seem to get the Slick-C stack though. I don't know if the two problems could be related yet.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Two slick stacks from multi-file search & replace
« Reply #8 on: August 11, 2016, 09:26:55 PM »
The word match issue is a subtle difference between the word matching algorithm in sgrep and the word matching algorithm in the editor. That's why there's a difference. We will fix this.

The Slick-C stack is being caused by something else.
« Last Edit: August 11, 2016, 11:29:59 PM by Clark »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Two slick stacks from multi-file search & replace
« Reply #9 on: August 12, 2016, 01:41:45 PM »
Reproduced the Slick-C stack. Can reproduce it every time now. Thanks for the help. Trick seems to be having buffers open

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: Two slick stacks from multi-file search & replace
« Reply #10 on: August 12, 2016, 09:44:30 PM »
Fixed in beta 3