-
-
Notifications
You must be signed in to change notification settings - Fork 256
Description
Hey 👋🏾
I'm currently trying to improve my snippets as some of them expand automatically too often when it doesn't fit. Therefore I want to check if there is nothing in the line after the trigger. In theory this should be a simple end-of-line match in the trigger. But that doesn't work. Adding this makes the snippet never expand.
Here is an example. The trigger I was using so far was if[%( ]
. So I simply added $
at the end of the trigger (see below). That doesn't work. To simplify the problem I also tried if $
, but doesn't work neither.
Using ^
to match the start of the line works fine for me. No I'm unsure if this has something to do with how regular expressions are matched in the context of LuaSnip or if I don't understand a special case of the Lua expression syntax.
snippet(
{ trig = ' if[%( ]$', regTrig = true },
if_node, -- ignore here to a simple example
}
Thanks for your help!