Sublime Forum

Snippets in find, input panels?

#1

I think this would be great, but probably unfeasible.

More enhancements to the input panel: being able to apply syntaxes in the input panel would be cool.

Both pretty low priority, anyway.

0 Likes

#2

Syntax highlighting should be possible as it’s somewhat roughly done I think in the find and friends panels for regex. Not sure how useful it’d be but I don’t think it’d be as big a deal to get working as snippets.

0 Likes

#3

The only thing stopping snippets from working in the various panels is that tab is used to move between fields, which takes precedence over normal key bindings.

You could make a snippet, and bind it to a key sequence that doesn’t end it tab, and it should work fine.

With the input panel, you can set the syntax with:

view = window.showInputPanel("Name", "", None, None, None)
view.options().set("syntax", "Packages/HTML/HTML.tmLanguage")
0 Likes

#4

Fantastic! I should pay more attention to the API docs…

0 Likes