Skip to content

expr mapping + choice gives an error #429

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

You must be logged in to vote

Yeah, I think there are some restrictions on which functions you're allowed to call with expr=true, and we call those :|
You can still map it via vimscript though:

imap <silent><expr> <C-E> luasnip#choice_active() ? '<Plug>luasnip-next-choice' : '<C-E>'
smap <silent><expr> <C-E> luasnip#choice_active() ? '<Plug>luasnip-next-choice' : '<C-E>'

imap <silent><expr> <C-T> luasnip#choice_active() ? '<Plug>luasnip-prev-choice' : '<C-T>'
smap <silent><expr> <C-T> luasnip#choice_active() ? '<Plug>luasnip-prev-choice' : '<C-T>'

(Something along those lines should work.)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kraftwerk28
Comment options

@L3MON4D3
Comment options

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