Sublime Forum

Expand selection till find

#1

Hi,
I have been trying to write up a simple plugin that will expand the selection till a found text, something like:

def func1(arg1, arg2):
    pass

def func_name2(arg1, arg2):
    pass

and say you have multiple cursors right after “def” and you want to expand selection till the arg2, so you could run this search and it will expand the selection.
The problem is that I can’t seem to get it to work with the standard incremental search dialog, only with the show_input_panel, which means no extra options (toggle regular expressions, backwards search).

Am I missing something or is this not currently supported?

0 Likes

#2

BTW, just in case anyone wants to play with it:
https://gist.github.com/4701164
Another problem I am having is with moving the cursor to the end of the selection, for some reason it only works when there is an existing selection that is being expanded and not an empty selection.

I know that this should probably be split between a window command and a text command, but that is for future work :smile:

0 Likes