Closed mityu closed 4 years ago
Could you please try to add 'n'
for second argument of feedkeys?
I'm sorry, I forgot to write a example of the problem.
A snippet file, snip-func.vim
:
function! {{_cursor_}}()
endfunction
and following mapping:
:imap <C-k> <Plug>(sonictemplate)func<CR>a
Type <C-k>
on a buffer for vimscript.
('|' is the cursor.)
function! a|()
endfunction
function! {|()
endfunction
I think that <bs>
inputs by feedkeys() are evaluated after evaluating 'a' in the rhs of <C-k>
, so <bs>
deletes {_cursor_}}a
and {
stays on the buffer.
Note that I found this problem with this my asyncomplete source for sonictemplate's snippets: https://github.com/mityu/dotfiles/blob/53098561a690d01978f9984dc43fcdb2704bbb56/dot_vim/vimrc#L1064-L1108
Could you please try to add 'n' for second argument of feedkeys?
I tried it, but adding 'n' didn't fix this problem. (also, adding 'x' or 'nx' didn't fix this problem.)
Oh, the commit message isn't right... I'll change it.
Sorry my delay. Probably, this PR does not work with insert-mode.
Sorry for my delay too. Fixed this PR doesn't work with insert-mode.
LGTM, Thank you.
feedkeys() takes some time by evaluating keys.feedkeys() does only adding characters to the queue of key inputs.