Postfix default behavior #897
Answered
by
L3MON4D3
MunifTanjim
asked this question in
Q&A
-
Shouldn't postfix by default require that there are text before it? For example: local increment = postfix({
trig = "++",
hidden = true,
condition = has_word_before,
}, {
f(function(_, parent)
return string.format("%s = %s + 1", parent.snippet.env.POSTFIX_MATCH, parent.snippet.env.POSTFIX_MATCH)
end, {}),
}) I'm doing this, using If there are whitespace characters before the trigger, it's not really postfix anymore, right? |
Beta Was this translation helpful? Give feedback.
Answered by
L3MON4D3
May 25, 2023
Replies: 1 comment 2 replies
-
Mhmmm I guess we could introduce that requirement.. is there any benefit beside this being conceptually cleaner? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeeeeaaaah okay, I think that's one of those things that mainly happens while testing, and one then never notices while actually doing something else :D
But it would be nice to not display postfix-snippets in eg.
nvim-cmp
if they don't actually match at the moment.And in any case, including the condition/show_condition should not hurt (but we should include an option to turn this behaviour off, just to be safe)