-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Bug with %%
snippet from jinja snippets file from vim-snippets
#1205
Comments
Hi :) priority 1000
snippet %
{% ${1} %}
priority 1001
snippet %%
{% ${1:tag_name} %}
${0}
{% end$1 %} where 1000 is the default, and 1001 should (IIRC) cause %% to be checked first |
Interesting, I'll try this out when I can, thanks! If it works this should be good as a workaround, but I would expect that the snippets file from vim-snippets would work as expected without needed modification. I guess it's possible that it's an issue with the snippets file itself? Is the behavior what you would expect given the snippets file? If so I could file an issue with vim-snippets. |
Mhmmm, I'd have interpreted this as a clear ambiguity, so expanding either of these is equally correct.. Which snippet-engine were you using before that had your expected behaviour? Is there some spec on how these cases are to be handled? |
Hey so sorry I didn't see this until now. I hadn't actually tested this with any other engine, but I assumed that the behavior I get from LuaSnips was not correct since my snippets file was from the vim-snippets plugin, which is mentioned in the README. It does make sense to me for % and %% to be treated as separate snippets by the engine, either by checking length as you suggested or by taking into account the order in the snippets file. I would be willing to check how other engines deal with this case and maybe open an issue with vim-snippets if appropriate, but I'm not sure when I'll have time since school is starting for me shortly. |
Oh, no worries :) |
The jinja snippets file from vim-snippets has the following two snippets:
At least with my configuration, typing
%%
and then theexpand_or_jump
trigger expands the first snippet and leaves the first percent, when I would expect it to expand the second snippet instead. I did try changing the order of the snippet definitions, no change.The text was updated successfully, but these errors were encountered: