Home Download Buy Blog Forum Support

alt-f3 (search all under)

alt-f3 (search all under)

Postby vim on Mon Jun 08, 2009 12:17 pm

hi jon, did you change the behavior of the alt-f 'search all under'? it used to select all under, and to also use the selected text as the new search string. i see that now it just select it all over the file, but the search string is not updated, so pressing f3 after alt-f3 will search the string i searched before.

is this change intentional?

vim.
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: alt-f3 (search all under)

Postby jps on Mon Jun 08, 2009 12:26 pm

I'm not able to reproduce this, my steps are:

- Navigate the cursor to a word
- Press Alt+F3: all occurrences of the word are selected
- Press F3: the first occurrence of the word is selected. Pressing again goes to the next etc.

I'm not able to get F3 to use the wrong search term. Is this the set of steps you are using?
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: alt-f3 (search all under)

Postby vim on Mon Jun 08, 2009 12:49 pm

after your reply i have searched all the packages for another use of alt+f3. SearchInArea package was using it, and probably caused this problem.

i have removed the package and it is all back to normal, thanks!

btw, do you remember the sticky search feature? i guess that with the new API for findAll i can partially implement it, but i was hoping to be able to mark text with other colors.
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: alt-f3 (search all under)

Postby jps on Mon Jun 08, 2009 12:53 pm

vim wrote:btw, do you remember the sticky search feature? i guess that with the new API for findAll i can partially implement it, but i was hoping to be able to mark text with other colors.


It's not forgotten about, and I'm keen to see it. I'm not quite sure when it'll make it in though.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: alt-f3 (search all under)

Postby vim on Tue Jun 09, 2009 6:00 am

i had little problems writing a searchAllUnder-like plugin:
Code: Select all
import sublime, sublimeplugin

class StickySearchCommand(sublimeplugin.TextCommand):
   def run(self, view, args):
      selection = view.sel()[0]
      if selection.begin() - selection.end() != 0:
         pattern = "\<" + view.substr(selection) + "\>"
      else:
         pattern = "\<" + view.substr(view.word(selection)) + "\>"
      
      # mark new region
      region_list = view.findAll(pattern)
      # reset selection
      view_selection = view.sel()
      view_selection.clear()
      # add new selection
      for region in region_list:
         view_selection.add(region)
      


but (of course) it won't stick... i need the selection to stick even if i do another regular search (ctrl-f/f3/alt-f3/etc.) i also need a way to alter the selection color to make it unique. in my experience this feature is very valuable, when you browse your code and want to instantly highlight keywords.
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: alt-f3 (search all under)

Postby jps on Tue Jun 09, 2009 1:17 pm

sublimator wrote:Jon, assuming that somehow we had a reference to the find panel View, would just altering the its contents suffice to set the GUI find search string?


Yes: the contents of the view in the find panel is the source used for find next etc.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 17 guests