get rid of "open" nodes
sometimes I don't jump through all the placeholders and there are still "unfinished" or "open" nodes or however you want to call them I got virtual text for nodes enabled and there is still some stuff ツ (tell me if it's even with those great explanations 😂 not clear what I mean) anyway this can sometimes lead to things like text getting inserted at random locations I wonder if there already is an api to be able to just get rid of all of those nodes. if not it would be really useful if this would be added.
Know what you mean :sweat_smile:
You can work with region_check_events to jump out of those nodes on certain autocommand-events.
yes i know that but it would be useful to just get rid of them wherever you are without events
ig I could just do some hacky stuff myself with those functions
require("luasnip").exit_out_of_region(
require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
)
but I'd prefer using a native solution
I guess the proper behaviour would be to completely leave the currently active snippet if the newly expanded snippet is not inside it, right? I'm about to improve the insertion-behaviour of snippets (base it on location in the buffer, not the currently active node while expanding the snippet), I'll definitely keep in mind to tack that on. Until then, feel free to do something hacky, I don't think there will be many changes until I implement that :wink:
I will rephrase the main problem as I am not 100% sure if my issue is the same (though I think so).
When I perform snippet expansion sometimes I don't jump over every placeholder and move on with the coding flow.
Then, whenever I use Tab I will be teleported back to "unfinished" placeholder locations which breaks the coding flow.
@max397574 How did you make the virtual text to show you the "open nodes"?
yes that's the same issue read the wiki for the virtual text
Okay, I think d9cb6ab should go a long way in improving behaviour here, lmk if there are still issues