Skip to content

Commit e9cc383

Browse files
authored
LSP: support tagstack neovim#12096
1 parent 4e6531d commit e9cc383

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

runtime/lua/vim/lsp/util.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,13 @@ function M.jump_to_location(location)
421421
local bufnr = vim.uri_to_bufnr(location.uri)
422422
-- Save position in jumplist
423423
vim.cmd "normal! m'"
424-
-- TODO(ashkan) use tagfunc here to update tagstack.
424+
425+
-- Push a new item into tagstack
426+
local items = {}
427+
table.insert(items, {tagname=vim.fn.expand("<cword>"), from=vim.fn.getpos('.')})
428+
vim.fn.settagstack(vim.fn.bufnr('%'), {items=items}, 't')
429+
430+
--- Jump to new location
425431
api.nvim_set_current_buf(bufnr)
426432
local row = location.range.start.line
427433
local col = location.range.start.character

0 commit comments

Comments
 (0)