i had little problems writing a searchAllUnder-like plugin:
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.