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.36k stars 175 forks source link

feature: Auto close trouble window when a reference is selected #300

Closed nrayamajhee closed 1 year ago

nrayamajhee commented 1 year ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

Is it possible to have a setting to automatically close the trouble window when I select a reference? The way I use Trouble is: I have gr bound to TroubleToggle lsp_references. When I open reference, trouble window opens up; moving the cursor over each reference shows me the referenced file in the main window; then I press enter to switch cursor to that file. However, this leaves the trouble window open which is annoying to switch to close manually. It would be great if this was a configurable setting.
There are some auto-close trouble settings in the configurations but I couldn't find what I was looking for.

Describe the solution you'd like

A setting to automatically close trouble window when a reference is selected.

Describe alternatives you've considered

None. I just manually switch buffers and close the Trouble window.

I used to use this plugin: https://github.com/RishabhRD/nvim-lsputils for this exact use case. But Trouble is so much better even despite this issue.

Additional context

No response

waynerv commented 1 year ago

there is already a action_key: jump_close(default mapping o) , is that what you want?

nrayamajhee commented 1 year ago

OMG, Yes! Thank you. I didn't RTFM.