You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues of trouble.nvim
I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.10
Operating system/version
window 11 (wsl)
Describe the bug
Click an item in the symbol outline, then click the previously opened buffer, and the window will jump multiple times. The specific phenomenon is: after the first click, the specified symbol will be located in the open buffer window, and then click the file buffer window, and the cursor will move to the last position of the item in the outline. Click the file buffer window again to work normally(You may need to click the previously opened buffer window multiple times). When you double-click the symbol, you can jump normally.
first click
click the opened buffer
The same problem exists in the reference outline.
Steps To Reproduce
open outline
Click any symbol in the outline
Click the previously opened buffer window
Expected Behavior
Clicking the content in the outline has the same effect as double-clicking it, and jumps to the specified symbol position correctly.
Repro
-- DO NOT change the paths and don't remove the colorschemelocalroot=vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .reprofor_, nameinipairs({ "config", "data", "state", "cache" }) dovim.env[("XDG_%s_HOME"):format(name:upper())] =root.."/" ..nameend-- bootstrap lazylocallazypath=root.."/plugins/lazy.nvim"ifnotvim.loop.fs_stat(lazypath) thenvim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
endvim.opt.runtimepath:prepend(lazypath)
-- install pluginslocalplugins= {
"folke/tokyonight.nvim",
"folke/trouble.nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root=root.."/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
The text was updated successfully, but these errors were encountered:
When you click on an item in the doc symbols, or any other item, a preview will open of the item location.
The default preview has type main which is a floating window displayed over your main editor window that pretty much looks the same as your real window
When you click on that preview window, you're leaving the trouble window
When leaving the trouble window, the preview is automatically closed
So you'll see the window return to the state as before
The double click is a default keybind to jump. You can change that behavior, by adding a ["<leftmouse>"] = "jump", to jump on single click.
However, this also means you'd no longer be able to focus the trouble window.
I'll see if I can detect clicks on the main buffer window and reposition the cursor to the peview location in that case
I was finally able to fix this. I actually looked into this issue a long time ago with Trouble v2, but never found a proper way to deal with this.
But with my new changes it should all work as expected :)
I was finally able to fix this. I actually looked into this issue a long time ago with Trouble v2, but never found a proper way to deal with this. But with my new changes it should all work as expected :)
Thank you for your support and help. After updating to the latest version, the single-click effect and double-click effect now work normally.👍
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10
Operating system/version
window 11 (wsl)
Describe the bug
Click an item in the symbol outline, then click the previously opened buffer, and the window will jump multiple times. The specific phenomenon is: after the first click, the specified symbol will be located in the open buffer window, and then click the file buffer window, and the cursor will move to the last position of the item in the outline. Click the file buffer window again to work normally(You may need to click the previously opened buffer window multiple times). When you double-click the symbol, you can jump normally.
The same problem exists in the reference outline.
Steps To Reproduce
Expected Behavior
Clicking the content in the outline has the same effect as double-clicking it, and jumps to the specified symbol position correctly.
Repro
The text was updated successfully, but these errors were encountered: