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

Cannot return to the previous jump position using Ctrl+O with the latest version #42

Closed
zaiqiang-dong opened this issue Jul 12, 2024 · 7 comments
Assignees

Comments

@zaiqiang-dong
Copy link

Describe the bug
Cannot return to the previous jump position using Ctrl+O with the latest version
back to :
commit 4086cbb
Author: Dhananjay [email protected]
Date: Thu Jul 4 14:02:37 2024 +0530

FUNDING

works ok!!!

To Reproduce
Steps to reproduce the behavior:

  1. cscope find s "xxx"
  2. select and jump to
  3. repeat 1 and 2 many times
  4. return with ctrl+o

Expected behavior
ctrl+o can return old position.

Screenshots
If applicable, add screenshots to help explain your problem.

nvim version (please complete the following information):
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info

@dhananjaylatkar
Copy link
Owner

Hi @zaiqiang-dong

I'm not able to repro this issue. Can elaborate on steps to repro. Also provide your config.

PS. cscope_maps.nvim does not modify jumplist so it should not create any regression for it.

@zaiqiang-dong
Copy link
Author

zaiqiang-dong commented Jul 14, 2024

my cscope_maps.nvim config is:

return {
	"dhananjaylatkar/cscope_maps.nvim",
	event = "VeryLazy",
	-- commit = "4086cbb0fa1553830a3a27e3efe57adf6ebe5531",
	dependencies = {
		{ "tpope/vim-surround" },
		{ "dhananjaylatkar/cscope_maps.nvim" },
		{ "folke/which-key.nvim" },
		{ "nvim-telescope/telescope.nvim" },
	},
	config = function()
		require("cscope_maps").setup({
			cscope = {
				db_file = "./cscope.out", -- location of cscope db file
				exec = "cscope", -- "cscope" or "gtags-cscope"
				use_telescope = true, -- true will show results in telescope picker
				picker = "telescope",
				db_build_cmd_args = { "-bqkv" }, -- args used for db build (:Cscope build)
			},
			disable_maps = true,
			vim.api.nvim_set_keymap(
				"n",
				"cs",
				[[<cmd>lua require('cscope_maps').cscope_prompt('s', vim.fn.expand("<cword>"))<cr><cr>]],
				{ noremap = true, silent = false }
			),
			vim.api.nvim_set_keymap(
				"n",
				"cd",
				[[<cmd>lua require('cscope_maps').cscope_prompt('g', vim.fn.expand("<cword>"))<cr><cr>]],
				{ noremap = true, silent = false }
			),
			vim.api.nvim_set_keymap(
				"n",
				"cc",
				[[<cmd>lua require('cscope_maps').cscope_prompt('c', vim.fn.expand("<cword>"))<cr><cr>]],
				{ noremap = true, silent = false }
			),
		})
	end,
}

video

jump is like this:

  1. ipc/mqueue.c:1705 kmem_cache_create
  2. mm/slab_common.c:569 kmem_cache_create
  3. mm/slab_common.c:462 kmem_cache_create_usercopy
  4. mm/slab_common.c:387 create_cache
  5. mm/slub.c:4397 __kmem_cache_create
  6. mm/slub.c:3710 kmem_cache_open
  7. mm/slub.c:3569 calculate_sizes

return whih ctrl+o like this:
7. mm/slub.c:3569 calculate_sizes
ctrl+o
4. mm/slab_common.c:387 create_cache
ctrl+o

  1. ipc/mqueue.c:1705 kmem_cache_create

@dhananjaylatkar
Copy link
Owner

hey @zaiqiang-dong

issue is due to how telescope handles absolute paths. When abs path is given to telescope, it only changes cursor position.
Changing cursor position does not update jumplist.

I would suggest you to use <C-t> until telescope merges nvim-telescope/telescope.nvim#3205.

@dhananjaylatkar
Copy link
Owner

BTW, which colorscheme are you using?

@zaiqiang-dong
Copy link
Author

hey @zaiqiang-dong

issue is due to how telescope handles absolute paths. When abs path is given to telescope, it only changes cursor position. Changing cursor position does not update jumplist.

I would suggest you to use <C-t> until telescope merges nvim-telescope/telescope.nvim#3205.

OK,got it, thanks,.

@zaiqiang-dong
Copy link
Author

BTW, which colorscheme are you using?

I only use a colors.vim and config by myself.

@dhananjaylatkar
Copy link
Owner

Added workaround in cscope since it will take time for telescope PR to merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants