mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 03:10:04 -04:00
feat(refactor.navigation): update jumplist on jump
Push a jumplist item when using `goto_definition`. Fixes #166
This commit is contained in:
parent
250289b3d6
commit
919b38091f
1 changed files with 3 additions and 0 deletions
|
|
@ -11,6 +11,9 @@ function M.goto_definition(bufnr)
|
||||||
local bufnr = bufnr or api.nvim_get_current_buf()
|
local bufnr = bufnr or api.nvim_get_current_buf()
|
||||||
local node_at_point = ts_utils.get_node_at_cursor()
|
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
|
if not node_at_point then return end
|
||||||
|
|
||||||
local definition, _ = ts_utils.find_definition(node_at_point, bufnr)
|
local definition, _ = ts_utils.find_definition(node_at_point, bufnr)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue