Home Download Buy Blog Forum Support

How to act uniquely per line on tab

How to act uniquely per line on tab

Postby phobia on Fri Nov 23, 2012 1:32 pm

Hi!

I need to generate different content for each instance of a keyword, when the user presses tab.

An example (pipe represents carret):
Code: Select all
foo|
foo|
foo|


now, if tab is pressed, I want it to end up something like this:
Code: Select all
bar1
bar2
bar3


How can I achieve this?

I tried using on_query_completions, but it seems to run only once per unique keyword/prefix, so the result would be e.g. "bar1" three times.

I also tried just making a TextCommand and bind the tab key to it via a sublime-keymap file, but then my plugins kills all normal tab activity. Is it possible to trigger the normal tab behavior from my plugin?
phobia
 
Posts: 2
Joined: Fri Nov 23, 2012 12:37 pm

Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests