LSP: support tagstack #12096

This commit is contained in:
Yen3 2020-04-28 16:47:22 +02:00 committed by GitHub
parent 4e6531ddbd
commit e9cc383614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -421,7 +421,13 @@ function M.jump_to_location(location)
local bufnr = vim.uri_to_bufnr(location.uri)
-- Save position in jumplist
vim.cmd "normal! m'"
-- TODO(ashkan) use tagfunc here to update tagstack.
-- Push a new item into tagstack
local items = {}
table.insert(items, {tagname=vim.fn.expand("<cword>"), from=vim.fn.getpos('.')})
vim.fn.settagstack(vim.fn.bufnr('%'), {items=items}, 't')
--- Jump to new location
api.nvim_set_current_buf(bufnr)
local row = location.range.start.line
local col = location.range.start.character