Hello.
I have a long list of custom snippets I have defined in different sub-directories.
When the list above is shown, I’d like to navigate snippets, then press alt+enter
to go to the snippet definition / file.
I am able to map a key-binding to invoke when the completions list above is shown:
{ "keys": ["alt+enter"],
"command": "goto_snippet_definition",
"context": [ { "key": "auto_complete_visible" }] },
…but I don’t know how to tell my plugin which was the line which was highlighted right before calling the plugin. I believe that what I need is the selection index, something similar to show_quick_panel()
's on_select()
/ on_highlight
callbacks (link).
FWIW, I have noticed ST by default defines a command which is able to do something like this.
{ "keys": ["f12"], "command": "auto_complete_open_link", "context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": true },
]
},
The above key-binding allows you to press “F12” while navigating the completions list and show you something different each time, so theoretically this appears possible.
Thanks in advance.