You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling to make a snippet show up in completions only when at the top level of a file (so in an empty line). I've tried using the line parameter of show_condition, but that includes the trigger text.
How can I achieve this functionality?
main| // <- Show snippet triggered by mainintfoo() {
main| // Don't show it here
}
The text was updated successfully, but these errors were encountered:
Hi :)
Ah, using show_condition you'll have to manually remove the trigger-text (which may be trivial or not, depending on the trigEngine).
Maybe we should pass the snippet itself to show_condition then one could manually call snippet:matches(line_to_cursor) and get the complete trigger-region luasnip would use
Maybe we should pass the snippet itself to show_condition then one could manually call snippet:matches(line_to_cursor) and get the complete trigger-region luasnip would use
That sounds like a good idea! It might break some people's configs though, so we should notify them of the breaking change.
Oh, I would've passed it after the current line_to_cursor, there shouldn't be any breakage.
One small issue with changing what is passed to show_condition is that we aren't actually call it, that's the responsibility of eg. cmp_luasnip, so all of those plugins have to make a small change
Hello! Not a bug but more of a question :)
I'm struggling to make a snippet show up in completions only when at the top level of a file (so in an empty line). I've tried using the
line
parameter ofshow_condition
, but that includes the trigger text.How can I achieve this functionality?
The text was updated successfully, but these errors were encountered: