Author Topic: Be able to break into (cancel) a search  (Read 3647 times)

jac11901

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Be able to break into (cancel) a search
« on: August 16, 2013, 05:03:47 PM »
I frequently edit large (GB) files over a network.  Searches can take a long time.  I would like to be able to break into (cancel) a search that's underway, perhaps with the escape key.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Be able to break into (cancel) a search
« Reply #1 on: August 17, 2013, 10:12:27 AM »
background searches might be cancelled with the 'stop-search' command (bound to a shortcut).
Hope it helps, HS2
« Last Edit: August 17, 2013, 10:19:19 AM by hs2 »

jac11901

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Be able to break into (cancel) a search
« Reply #2 on: August 19, 2013, 09:28:14 PM »
Thanks for the suggestion, I was not aware of the stop-search command.  Unfortunately, when I tried it, SlickEdit aborted rather than stopping the search.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Be able to break into (cancel) a search
« Reply #3 on: August 20, 2013, 12:45:34 AM »
What do you mean with 'SE aborted' ?
Normally you should see something like this in the selected Search<N> tab:
Quote
Search terminated
Total found: 5670     Matching files: 78     Total files searched: 84
HS2

jac11901

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Be able to break into (cancel) a search
« Reply #4 on: August 20, 2013, 11:20:51 PM »
See the attached image.

dunkers

  • Senior Community Member
  • Posts: 774
  • Hero Points: 36
Re: Be able to break into (cancel) a search
« Reply #5 on: August 21, 2013, 11:18:34 AM »
You want to see more crashes?  ???

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Be able to break into (cancel) a search
« Reply #6 on: August 21, 2013, 07:28:01 PM »
@dunkers: The crash is related to this posting. HS2

dunkers

  • Senior Community Member
  • Posts: 774
  • Hero Points: 36
Re: Be able to break into (cancel) a search
« Reply #7 on: August 21, 2013, 09:11:37 PM »
@HS2: Ah, yes. I just got so used to seeing standalone requests in here that I hadn't considered it might be a reply to something. Sorry :)

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Be able to break into (cancel) a search
« Reply #8 on: May 03, 2014, 09:52:32 AM »
@rowbearto background searches can be stopped with the 'stop-search' command or using the 'Stop' button in 'Find in Files' dialog.
In your case try background 'Find in Files' with <Current Buffer> to do a search which can be stopped.
HS2

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Be able to break into (cancel) a search
« Reply #9 on: May 03, 2014, 12:37:45 PM »
hs2:  Background searches only apply to searches of "Find in Files".

But in the case I described, no background search is done, because I am only searching a single file with the "Find" and not "Find in Files".

When using "Find" in just 1 editor window that has a very large file, SE performs the find in the main thread and blocks all input to the GUI - so I have no opportunity to invoke the 'stop-search' command or 'Stop' button in 'Find in Files'.  The entire GUI is blocked from any input.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Be able to break into (cancel) a search
« Reply #10 on: May 03, 2014, 12:45:19 PM »
@rowbearto: I'm aware of the various search scenarios.
That's the reason why I proposed using background 'Find in Files' with 'Look in' set to <Current Buffer>' to better deal with your use case.
Give it a try, HS2

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Be able to break into (cancel) a search
« Reply #11 on: May 03, 2014, 01:03:34 PM »
OK, I can try that as a workaround, thanks for the tip.

But I still think that SE can be improved if they modified "Find" so that it also performs background searches and allows the user to abort.  I'm usually on automatic pilot and may use "Find" without remembering I'm in a large file.  I'd like to always use "Find" in a single file without having to think about whether I should use "Find in Files" or "Find".  I think the purpose of "Find" is to search a single file, and I'd like SE to be improved so that I can use "Find" even with large files and be able to abort the search if it is taking too long. 

Maybe the SE developers can reuse the code for "Find in Files" for the "Find" case with "List all occurrences", so that "Find" can also be done in the background?

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Be able to break into (cancel) a search
« Reply #12 on: May 03, 2014, 05:35:30 PM »
hs2:  I just tried "Find in Files" and <current buffer>, and that freezes SE also while searching through the very huge logfile.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Be able to break into (cancel) a search
« Reply #13 on: May 03, 2014, 06:12:14 PM »
When saving a very large file, can it be done in the background so that I can edit/view another file while the very large file is getting saved?

SE was locked with the circle while the save was going on, although SE did give updates in the status bar as a (location %done).

Still it would be nice if I could edit/view other files while the large file is getting saved.