diff options
| author | dagle <per.odlund@gmail.com> | 2022-05-18 19:59:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-18 19:59:12 +0200 |
| commit | 3cc44f8f0517739f657ff8b39227fe8f07f9443c (patch) | |
| tree | cdb29d36a3dc279ebeb9957cdbab3064dd9c88c5 /lua/telescope/actions | |
| parent | 01fc5a9274b553937bae3910e520732eb0a49bc6 (diff) | |
fix: set tagstack when we jump with lsp in telescope (#1887)
Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Diffstat (limited to 'lua/telescope/actions')
| -rw-r--r-- | lua/telescope/actions/set.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua index 06e2301..4faf947 100644 --- a/lua/telescope/actions/set.lua +++ b/lua/telescope/actions/set.lua @@ -133,14 +133,21 @@ action_set.edit = function(prompt_bufnr, command) local picker = action_state.get_current_picker(prompt_bufnr) require("telescope.actions").close(prompt_bufnr) local win_id = picker.get_selection_window(picker, entry) - if win_id ~= 0 and a.nvim_get_current_win() ~= win_id then - vim.api.nvim_set_current_win(win_id) - end if picker.push_cursor_on_edit then vim.cmd "normal! m'" end + if picker.push_tagstack_on_edit then + local from = { vim.fn.bufnr "%", vim.fn.line ".", vim.fn.col ".", 0 } + local items = { { tagname = vim.fn.expand "<cword>", from = from } } + vim.fn.settagstack(vim.fn.win_getid(), { items = items }, "t") + end + + if win_id ~= 0 and a.nvim_get_current_win() ~= win_id then + vim.api.nvim_set_current_win(win_id) + end + if entry_bufnr then if not vim.api.nvim_buf_get_option(entry_bufnr, "buflisted") then vim.api.nvim_buf_set_option(entry_bufnr, "buflisted", true) |
