folke / trouble.nvim

🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Apache License 2.0
5.15k stars 173 forks source link

Issue returning to previous view after jumping to an item in Trouble list #385

Closed sdbuch closed 3 months ago

sdbuch commented 4 months ago

Hi,

I'm seeing a problem where after jumping to an item in the Trouble list (e.g., pressing <cr> with default bindings), trying to return to my previous view in the file I'm editing (e.g., with CTRL+o) does not work. I.e., pressing CTRL+o does not return to the view immediately prior to jumping, but whatever was before it on the jump list.

I was able to fix this issue (at least superficially) by inspecting these lines of code:

https://github.com/folke/trouble.nvim/blob/main/lua/trouble/util.lua#L10-L13

and reversing the order of L11 and L13. That is, saving the current view with m' after switching to the desired window seems sensible here, and seems to fix my issue. I'm not sure if I'm overlooking other cases where the currently implemented behavior is to be desired.

I can provide much more detailed information about my setup (MWE etc.) if this cannot be reproduced. Thanks!

folke commented 3 months ago

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

sdbuch commented 3 months ago

Thanks!