Skip to content
Myr

[vim] Call feedkeys only when the destination buffer is a terminal

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #2352 Fix https://github.com/junegunn/fzf.vim/issues/1216 Close #2364

authored by Junegunn Choi · committed by Junegunn Choi · parent a367dfb · Browse files · 1 file+8 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−5 removed

  • other:+8 added−5 removed

1 file+8 added−5 removed

modified:plugin/fzf.vim+8 added-5 removed
762 unmodified lines
763 endif764 endtry765endfunction766767noremap <silent> <Plug>(fzf-normal) <Nop>768noremap! <silent> <Plug>(fzf-normal) <Nop>767nnoremap <silent> <Plug>(fzf-insert) i768nnoremap <silent> <Plug>(fzf-normal) <Nop>769if exists(':tnoremap')770 tnoremap <silent> <expr> <Plug>(fzf-normal) &filetype == 'fzf' ? "\<C-L>" : "\<C-\>\<C-n>"770 tnoremap <silent> <Plug>(fzf-insert) <Nop>771 tnoremap <silent> <Plug>(fzf-normal) <C-\><C-n>772endif773774function! s:execute_term(dict, command, temps) abort775 let winrest = winrestcmd()
22 unmodified lines
798 endfor799 call self.switch_back(1)800 else801 if bufnr('') == self.buf801 " Exit terminal mode first (see neovim#13769)802 call feedkeys("\<Plug>(fzf-normal)")802 " We use close instead of bd! since Vim does not close the split when803 " there's no other listed buffer (nvim +'set nobuflisted')804 close805 endif
16 unmodified lines
822823 call s:pushd(self.dict)824 call s:callback(self.dict, lines)825 call self.switch_back(s:getpos() == self.ppos)826827 if &buftype == 'terminal'828 call feedkeys(&filetype == 'fzf' ? "\<Plug>(fzf-insert)" : "\<Plug>(fzf-normal)")829 endif830 endfunction831832 try833 call s:pushd(a:dict)
162 unmodified lines