mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 19:46:58 -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 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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue