Sublime Forum

How to act uniquely per line on tab

#1

Hi!

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

An example (pipe represents carret):

foo|
foo|
foo|

now, if tab is pressed, I want it to end up something like this:

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?

0 Likes