hsnips
hsnips copied to clipboard
Feature request: new `e` flag for exact match
Hello, I have an issue that could be solved with a new flag. When the i
flag is used (for in-word expansion), the snippet will be triggered even if the trigger was not fully input by the user. The VSCode suggestion box comes up and tries to autocomplete the trigger that you started to input which can lead to unexpected behavior.
Consider the following hyper-snippet:
snippet xx "Cross" i
\\times
endsnippet
When typing the word latex
in a document, the VSCode suggestion dropdown comes up and tries to autocomplete the trigger xx
. If I press the trigger key, the snippet will expand (even though I did not typed xx
) resulting in late\times
.
(On top of that undoing with ctrl+z
will show latexx
as if I had typed xx
, that really confused me at first xD)
We could use the e
flag, standing for "exact", in the snippet definition that will solve this issue. A snippet that has this flag would be shown (and triggered) only if the exact match is typed by the user.
(latex<tab>
would not trigger the snippet but latexx<tab>
will)