Skip to content

Any way to re-position the cursor _after_ expansion? #1271

Answered by L3MON4D3
bew asked this question in Q&A
Discussion options

You must be logged in to vote

Oh, I think I have a nice way of achieving this: instead of moving the cursor after expansion, include any whitespace behind the cursor in the trigger!
While this is not possible with the trigger using the "plain" trigEngine, you can use resolveExpandParams to manipulate the region that is treated as the trigger (ie. deleted before expansion).

Moving the cursor reliably is more complicated I think, luasnip has a kind of queue for all movement-commands and I'd have to expose some way to enqueue into it (and add a callback that is invoked at the right time :D)

Replies: 1 comment 1 reply

Comment options

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

Answer selected by bew
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