mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-09-01 04:16: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)
|
if empty(excmd) || !filereadable(path)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let cmds = ['keepalt keepjumps hide edit '.s:escape(path),
|
let cmds = s:edit_cmds(a:winid, path)
|
||||||
\ 'keepjumps '.excmd, 'normal! ^zvzz']
|
\ + ['keepjumps '.excmd, 'normal! ^zvzz']
|
||||||
elseif a:kind ==# 'btags'
|
elseif a:kind ==# 'btags'
|
||||||
let parts = split(entry, "\t")
|
let parts = split(entry, "\t")
|
||||||
if len(parts) < 3 || !bufexists(a:bufnr)
|
if len(parts) < 3 || !bufexists(a:bufnr)
|
||||||
|
|||||||
Reference in New Issue
Block a user