Skip to content
Discussion options

You must be logged in to vote

Hi! :)

I think you're using something like nvim-cmp, and the snippets keeps showing up despite condition=false, is that correct?

In fact, condition only deals with manual expand, so typing the trigger and then whatever key you have ls.expand() mapped to; if condition returns false then, the snippet won't expand.

To hide the snippet in a completion listing, you can pass your function to show_condition instead of condition.

These two are separate because manual expansion and listing the snippet have different circumstances, for example there is no trigger available for show_condition.

Hope this helps, and sorry for the late reply :)

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@georgev93
Comment options

Answer selected by georgev93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants