Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: new e flag for exact match #45

Open
gruvw opened this issue May 17, 2021 · 0 comments
Open

Feature request: new e flag for exact match #45

gruvw opened this issue May 17, 2021 · 0 comments

Comments

@gruvw
Copy link

gruvw commented May 17, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant