Skip to content

Commit 4006768

Browse files
kailin4uprabirshrestha
authored andcommitted
call settagstack so that user can jump back to recent file positions by C-t (#435)
1 parent c91d0d5 commit 4006768

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

autoload/lsp/ui/vim.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,14 @@ function! s:handle_location(ctx, server, type, data) abort "ctx = {counter, list
435435
if empty(a:ctx['list'])
436436
call lsp#utils#error('No ' . a:type .' found')
437437
else
438+
if exists('*gettagstack') && exists('*settagstack')
439+
let from = [bufnr('%'), line('.'), col('.'), 0]
440+
let tagname = expand('<cword>')
441+
let winid = win_getid()
442+
call settagstack(winid, {'items': [{'from': from, 'tagname': tagname}]}, 'a')
443+
call settagstack(winid, {'curidx': len(gettagstack(winid)['items']) + 1})
444+
endif
445+
438446
if len(a:ctx['list']) == 1 && a:ctx['jump_if_one']
439447
normal! m'
440448
let l:loc = a:ctx['list'][0]

0 commit comments

Comments
 (0)