i had little problems writing a searchAllUnder-like plugin:
- Code: Select all
import sublime, sublimeplugin
def run(self, view, args):
selection = view.sel()
if selection.begin() - selection.end() != 0:
pattern = "\<" + view.substr(selection) + "\>"
pattern = "\<" + view.substr(view.word(selection)) + "\>"
# mark new region
region_list = view.findAll(pattern)
# reset selection
view_selection = view.sel()
# add new selection
for region in region_list:
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.