Home Download Buy Blog Forum Support

Expand selection till find

Expand selection till find

Postby doskey on Sun Feb 03, 2013 9:37 am

Hi,
I have been trying to write up a simple plugin that will expand the selection till a found text, something like:
Code: Select all
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?
doskey
 
Posts: 3
Joined: Thu Jan 10, 2013 5:51 am

Re: Expand selection till find

Postby doskey on Sun Feb 03, 2013 10:49 am

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 :)
doskey
 
Posts: 3
Joined: Thu Jan 10, 2013 5:51 am


Return to General Discussion

Who is online

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