LuaSnip icon indicating copy to clipboard operation
LuaSnip copied to clipboard

ext_opt Additional Table For Unvisited Nodes

Open 0x0D15 opened this issue 3 years ago • 6 comments

Would you consider adding adding a ext_opt table for nodes which are unvisited? There does not seem to be a way to specify the application of a highlight group to exclusively unvisited nodes with the currently available tables: passive, active, and snippet_passive. Therefore it would be helpful if there was an additional table which applied attributes exclusively to nodes that have not yet been jumped to. Thanks!

0x0D15 avatar Apr 30 '22 05:04 0x0D15

Oh that's a nice idea, I'm definitely not opposed. Should also be rather easy to implement :+1:

L3MON4D3 avatar Apr 30 '22 07:04 L3MON4D3

One problem: with active, passive, snippet_passive it's very clear when any of these highlights should be applied. Should unvisited only show while the snippet is active? Eg. snippet_passive ->(snippet is jumped into) unvisited -> (snippet is exited again) snippet_passive or unvisited? IMO it should be snippet_passive, but that isn't communicated directly by unvisited

L3MON4D3 avatar Apr 30 '22 08:04 L3MON4D3

I'd consider it most intuitive if unvisited was applied only when the snippet is active. But yeah the name "unvisited" doesn't really communicate that, maybe something like "active_unvisited"? Really anything you choose would be fine with me.

0x0D15 avatar May 01 '22 01:05 0x0D15

Okay, that's good, I wanted to make sure you didn't have some niche usecase that wouldn't play well with what I had in mind.

ext_opts_hierarchy I'm thinking of adding visited as well, then we could have the above inheritance for ext_opts and, during runtime, use either visited or unvisited for a given node (feels cleaner than passive and unvisited).

L3MON4D3 avatar May 01 '22 08:05 L3MON4D3

Looks good. Can't wait to use it.

0x0D15 avatar May 01 '22 16:05 0x0D15

Finally got to it, check #440 :)

L3MON4D3 avatar May 24 '22 18:05 L3MON4D3

Oh, it's merged now, closing this.

L3MON4D3 avatar Aug 30 '22 19:08 L3MON4D3

Looks good, thanks for your work.

0x0D15 avatar Sep 01 '22 03:09 0x0D15