mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-08-31 11:56:56 +08:00
Reuse s:edit_cmds for a tag in the file already shown
The tag branch edited the file unconditionally, unlike every other kind, so showing a tag in the window's own buffer reloaded it and reset the undo history. s:tags_sink does not re-edit either.
This commit is contained in:
@@ -723,8 +723,8 @@ function! s:goto_entry(winid, bufnr, dir, kind, entry) abort
|
||||
if empty(excmd) || !filereadable(path)
|
||||
return
|
||||
endif
|
||||
let cmds = ['keepalt keepjumps hide edit '.s:escape(path),
|
||||
\ 'keepjumps '.excmd, 'normal! ^zvzz']
|
||||
let cmds = s:edit_cmds(a:winid, path)
|
||||
\ + ['keepjumps '.excmd, 'normal! ^zvzz']
|
||||
elseif a:kind ==# 'btags'
|
||||
let parts = split(entry, "\t")
|
||||
if len(parts) < 3 || !bufexists(a:bufnr)
|
||||
|
||||
Reference in New Issue
Block a user