aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorYen3 <yen3rc@gmail.com>2020-04-28 16:47:22 +0200
committerGitHub <noreply@github.com>2020-04-28 07:47:22 -0700
commite9cc383614d449b7269632c991525db77c387154 (patch)
tree05d9f082d0ced1deaa44b000491fdc757839c1a1 /runtime/lua/vim/lsp/util.lua
parent4e6531ddbdce9944f9986ca5357b71171a14f05e (diff)
downloadrneovim-e9cc383614d449b7269632c991525db77c387154.tar.gz
rneovim-e9cc383614d449b7269632c991525db77c387154.tar.bz2
rneovim-e9cc383614d449b7269632c991525db77c387154.zip
LSP: support tagstack #12096
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 53e2240ff5..9ca18cb2b1 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -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