LuaSnip
LuaSnip copied to clipboard
`ext opts` for (un)visited nodes.
As proposed in #410.
For now the inheritance is (with arrows to gets-and-extends-ext_opts-from from)
flowchart TD
passive --> active
passive --> visited
passive --> unvisited
snippet_passive --> passive
although that feels a bit weird, maybe it would be better to combine ext_opts from visited and unvisited for active.
One example:
ls.setup_snip_env()
local node_ext_opts = {
visited = {
hl_group = "GruvboxPurple"
},
unvisited = {
hl_group = "GruvboxBlue"
},
}
ls.add_snippets("all", {
s("trig36", {
t{"no indent"}, c(3, {
t"a",
t"b",
t"c"
}, {
node_ext_opts = node_ext_opts
}), i(2, "some text"), i(1, "some text")
}, {
child_ext_opts = {
[types.insertNode] = {
passive = {
hl_group = "GruvboxRed"
},
visited = {
hl_group = "GruvboxOrange"
},
unvisited = {
hl_group = "GruvboxYellow"
},
}
}
})
}, {
key = "test"
})
Needs docs and tests.