diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index 1bcb3ec..d6e2628 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -454,6 +454,7 @@ function! s:history_sink(type, lines) return endif + let prefix = "\(-fzf-".a:type.')' let key = a:lines[0] let item = matchstr(a:lines[1], ' *[0-9]\+ *\zs.*') if key == 'ctrl-e' @@ -461,13 +462,16 @@ function! s:history_sink(type, lines) redraw call feedkeys(a:type."\") else - let g:__fzf_command = "normal ".a:type.item."\" + if a:type == ':' + call histadd(a:type, item) + endif + let g:__fzf_command = "normal ".prefix.item."\" call feedkeys("\(-fzf-vim-do)") endif endfunction function! s:cmd_history_sink(lines) - call s:history_sink("\(-fzf-:)", a:lines) + call s:history_sink(':', a:lines) endfunction function! fzf#vim#command_history(...) @@ -478,7 +482,7 @@ function! fzf#vim#command_history(...) endfunction function! s:search_history_sink(lines) - call s:history_sink("\(-fzf-/)", a:lines) + call s:history_sink('/', a:lines) endfunction function! fzf#vim#search_history(...)