lspsaga.nvim icon indicating copy to clipboard operation
lspsaga.nvim copied to clipboard

Jump list is messed up by Lspsaga's finder.

Open YaQia opened this issue 1 year ago • 0 comments

Describe the bug

Using <cmd>Lspsaga finder<cr> to jump to some references of a function. The jump list is not updated to the very first jump line, but still take itself as if it was in the original line. I guess it does not store the original line into the jump list's stack. 录屏 2024-09-01 16-42-37.webm

Steps to reproduce

Well, I can't get the minimal config with only one file. But this is the key file of lspsaga's config:

local config = function()
	require("lspsaga").setup({
		ui = {
			border = "rounded",
			lines = { "└", "├", "│", "─", "┌" },
		},
		beacon = {
			enable = false,
		},
		lightbulb = {
			enable = false,
		},
		symbol_in_winbar = {
			separator = " 🢖 ",
			folder_level = 0,
		},
		-- rename = {
		-- 	in_select = false,
		-- 	keys = { quit = "<esc>" },
		-- },
		outline = {
			close_after_jump = true,
			keys = { jump = "<CR>" },
		},
		finder = {
			keys = { toggle_or_open = "<CR>" },
		},
	})

	local keymap = vim.keymap.set

	-- lsp keymaps
	vim.api.nvim_create_autocmd("LspAttach", {
		group = vim.api.nvim_create_augroup("UserLspConfig", {}),
		callback = function(ev)
			-- Enable completion triggered by <c-x><c-o>
			vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"

			local opts = { buffer = ev.buf }
			keymap("n", "gD", "<cmd>Lspsaga finder def<cr>", opts)
			-- This conflicts with nvim-ufo --
			keymap("n", "gd", "<cmd>Lspsaga goto_definition<cr>", opts)
			-- keymap("n", "gd", vim.lsp.buf.definition, opts)
			keymap("n", "gr", "<cmd>Lspsaga finder def+imp+ref<cr>", opts)
			-- keymap("n", "gr", vim.lsp.buf.references, opts)
			keymap("n", "K", vim.lsp.buf.hover, opts)
			keymap("n", "gi", "<cmd>Lspsaga finder imp<cr>", opts)
			-- Buffer local mappings.
			-- See `:help vim.lsp.*` for documentation on any of the below functions
			-- keymap("n", "<C-k>", vim.lsp.buf.signature_help, opts)
			-- keymapis useless ↓
			-- keymapset("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts)
			-- keymapset("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts)
			-- keymapset("n", "<leader>wl", function()
			--  print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
			-- end, opts)
			-- keymap("n", "<leader>D", vim.lsp.buf.type_definition, opts)
		end,
	})
end

return {
	"nvimdev/lspsaga.nvim",
	event = "LspAttach",
	-- event = "VeryLazy",
	config = config,
	dependencies = {
		"nvim-treesitter/nvim-treesitter",
		"nvim-tree/nvim-web-devicons",
	},
}

BTW, I am using lazy.nvim as a plugin manager.

Expected behavior

Unlike the situation in the video, it should store the original jump line into the jump list and then update the jump line to the current line.

Neovim version (nvim -v)

v0.10.1

lspsaga commit

4ce44df

Terminal name/version

kitty/0.36.1

YaQia avatar Sep 01 '24 08:09 YaQia