Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump list is messed up by Lspsaga's finder. #1488

Open
YaQia opened this issue Sep 1, 2024 · 0 comments
Open

Jump list is messed up by Lspsaga's finder. #1488

YaQia opened this issue Sep 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@YaQia
Copy link

YaQia commented Sep 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant