LuaSnip icon indicating copy to clipboard operation
LuaSnip copied to clipboard

Is there a way to find out if the curser is on the last node?

Open kkrime opened this issue 1 year ago • 2 comments

Lets say I mave a snippet with 4 nodes, is there a way to find out if the curser is on the 4th (and last) node?

kkrime avatar Feb 06 '24 16:02 kkrime

Mhh, no, not easily.. We have all functionality for doing this, it's just a matter of plugging everything together correctly :D

What's your goal? Just so I can get an idea of what API would be appropriate :)

L3MON4D3 avatar Feb 14 '24 19:02 L3MON4D3

The goal is something like;

if I'm on the last node and I press ENTER, then I leave the snippet and move to the next line below in insert mode, or if I'm on the last node and I press ESC, then I leave the snippet and move to the next line below in normal mode,

kkrime avatar Feb 20 '24 12:02 kkrime