mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 12:44:24 +08:00
Revert "Feed 'a' only when Neovim terminal is used"
This reverts commit a48a9e8064.
This commit is contained in:
@@ -709,16 +709,9 @@ function! s:format_cmd(line)
|
|||||||
\ '\=s:nbs.s:yellow(submatch(1), "Function").s:nbs', '')
|
\ '\=s:nbs.s:yellow(submatch(1), "Function").s:nbs', '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:command_sink(lines)
|
function! s:command_sink(cmd)
|
||||||
if len(a:lines) < 2
|
let cmd = matchstr(a:cmd, s:nbs.'\zs\S*\ze'.s:nbs)
|
||||||
return
|
call feedkeys(':'.cmd.(a:cmd[0] == '!' ? '' : ' '))
|
||||||
endif
|
|
||||||
let cmd = matchstr(a:lines[1], s:nbs.'\zs\S*\ze'.s:nbs)
|
|
||||||
if a:lines[0] == 'ctrl-x'
|
|
||||||
execute cmd
|
|
||||||
else
|
|
||||||
call feedkeys(':'.cmd.(a:lines[1] == '!' ? '' : ' '))
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:format_excmd(ex)
|
function! s:format_excmd(ex)
|
||||||
@@ -759,8 +752,8 @@ function! fzf#vim#commands(...)
|
|||||||
let list = split(cout, "\n")
|
let list = split(cout, "\n")
|
||||||
return s:fzf({
|
return s:fzf({
|
||||||
\ 'source': extend(extend(list[0:0], map(list[1:], 's:format_cmd(v:val)')), s:excmds()),
|
\ 'source': extend(extend(list[0:0], map(list[1:], 's:format_cmd(v:val)')), s:excmds()),
|
||||||
\ 'sink*': s:function('s:command_sink'),
|
\ 'sink': s:function('s:command_sink'),
|
||||||
\ 'options': '--ansi --expect ctrl-x --tiebreak=index --header-lines 1 -x --prompt "Commands> " -n2,3,2..3 -d'.s:nbs}, a:000)
|
\ 'options': '--ansi --tiebreak=index --header-lines 1 -x --prompt "Commands> " -n2,3,2..3 -d'.s:nbs}, a:000)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
@@ -1032,8 +1025,8 @@ function! s:complete_insert(lines)
|
|||||||
|
|
||||||
let data = call(s:reducer, [a:lines])
|
let data = call(s:reducer, [a:lines])
|
||||||
execute 'normal!' ((s:eol || empty(chars)) ? '' : 'h').del.(s:eol ? 'a': 'i').data
|
execute 'normal!' ((s:eol || empty(chars)) ? '' : 'h').del.(s:eol ? 'a': 'i').data
|
||||||
if mode() =~ 't'
|
if has('nvim')
|
||||||
call feedkeys('a', 'n')
|
call feedkeys('a')
|
||||||
else
|
else
|
||||||
execute "normal! \<esc>la"
|
execute "normal! \<esc>la"
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user