feat(refactor.navigation): update jumplist on jump

Push a jumplist item when using `goto_definition`.

Fixes #166
This commit is contained in:
Thomas Vigouroux 2020-07-15 09:14:14 +02:00 committed by Stephan Seitz
parent 250289b3d6
commit 919b38091f

View file

@ -11,6 +11,9 @@ function M.goto_definition(bufnr)
local bufnr = bufnr or api.nvim_get_current_buf()
local node_at_point = ts_utils.get_node_at_cursor()
-- Set the item in jump list
vim.cmd "normal! m'"
if not node_at_point then return end
local definition, _ = ts_utils.find_definition(node_at_point, bufnr)