trouble.nvim
trouble.nvim copied to clipboard
closing trouble gives focus back to the wrong window
Suppose you have two windows open, and . is current cursor position
|--------------|-------------|
| | . |
| | |
| 1 | 2 |
| | |
| | |
|--------------|-------------|
running :Trouble opens the window and gives focus to the window (new . below)
|--------------|-------------|
| | |
| | |
| 1 | 2 |
| | |
| | |
|--------------|-------------|
| . |
| trouble |
|----------------------------|
now, pressing q (default keymap) results in the cursor going back to window 1
|--------------|-------------|
| . | |
| | |
| 1 | 2 |
| | |
| | |
|--------------|-------------|
where i feel it should probably go back to it's previous position in window 2
Were you able to fix this? I'm having the same issue here.
i was not able to fix it. i wouldn't even know where/how to start 😬
This is definitely a bug. Unfortunately I'm leaving on a vacation tomorrow, but I'll look into it once I'm back end of August.
i implemented a fix in https://github.com/folke/trouble.nvim/pull/72 - i've not built any vim plugins before so not 100% sure if that's correct, but it works for me locally @folke
@deecewan I'm traveling right now and didn't bring my laptop. Looking at your fix I think I know what's happening here. The switch to is doing pretty much what you do, with that difference that we set the current window first. Doing that triggers some autocmds inside trouble probably. I'll work on a proper fix once I'm back.
the current implementation never sets the window.
either way, there's no rush 😄 i'm using my fork for now
@folke any advance on this issue, or the attached PR (#72)? It'd be good to get back to the mainline 😄
I had to revert the PR, since it segfaults in combination with WhichKey somehow. I'll see for another way to fix this.
That's odd, the fix has the classic case of "works on my machine" even though I make extensive use of WhichKey. Which is awesome like all of your plugins, thank you for all your work @folke ^^
☝️ yeah i have both installed, and did the fix, and never noticed a problem
Development on the main branch is EOL.
Trouble has been rewritten and will be merged in main soon.
This issue/feature either no longer exists or has been implemented on dev.
For more info, see https://github.com/folke/trouble.nvim/tree/dev