mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-07 21:24:40 +08:00
@@ -454,6 +454,7 @@ function! s:history_sink(type, lines)
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let prefix = "\<plug>(-fzf-".a:type.')'
|
||||||
let key = a:lines[0]
|
let key = a:lines[0]
|
||||||
let item = matchstr(a:lines[1], ' *[0-9]\+ *\zs.*')
|
let item = matchstr(a:lines[1], ' *[0-9]\+ *\zs.*')
|
||||||
if key == 'ctrl-e'
|
if key == 'ctrl-e'
|
||||||
@@ -461,13 +462,16 @@ function! s:history_sink(type, lines)
|
|||||||
redraw
|
redraw
|
||||||
call feedkeys(a:type."\<up>")
|
call feedkeys(a:type."\<up>")
|
||||||
else
|
else
|
||||||
let g:__fzf_command = "normal ".a:type.item."\<cr>"
|
if a:type == ':'
|
||||||
|
call histadd(a:type, item)
|
||||||
|
endif
|
||||||
|
let g:__fzf_command = "normal ".prefix.item."\<cr>"
|
||||||
call feedkeys("\<plug>(-fzf-vim-do)")
|
call feedkeys("\<plug>(-fzf-vim-do)")
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:cmd_history_sink(lines)
|
function! s:cmd_history_sink(lines)
|
||||||
call s:history_sink("\<plug>(-fzf-:)", a:lines)
|
call s:history_sink(':', a:lines)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fzf#vim#command_history(...)
|
function! fzf#vim#command_history(...)
|
||||||
@@ -478,7 +482,7 @@ function! fzf#vim#command_history(...)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:search_history_sink(lines)
|
function! s:search_history_sink(lines)
|
||||||
call s:history_sink("\<plug>(-fzf-/)", a:lines)
|
call s:history_sink('/', a:lines)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fzf#vim#search_history(...)
|
function! fzf#vim#search_history(...)
|
||||||
|
|||||||
Reference in New Issue
Block a user