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.44k stars 177 forks source link

feature: Add option to fix input under cursor #427

Closed simonmandlik closed 4 months ago

simonmandlik commented 4 months ago

Did you check the docs?

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

Any Trouble window that uses the symbol under the cursor (like lsp_references, lsp_definitions, etc...) switches to different set of results when the cursor moves to a different symbol. This is useful when I want to inspect references of multiple symbols, but not when I want to use Trouble as a qf replacement. If I want to make some nontrivial change, the symbol under the cursor will inevitably change and I will loose all results from the Trouble window.

Describe the solution you'd like

Add an option to take the current symbol under the cursor only when invoking Trouble and not later (unless Trouble is re-invoked in a different location).

Describe alternatives you've considered

It is possible to first export trouble results to e.g. Telescope or qf and jump using that, but it seems as a step that could be easily avoided

Additional context

No response

folke commented 4 months ago

You can set auto_refresh = false, or when in a trouble list, just press R to toggle auto_refresh