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

[Question] How can I see the error/warning/etc. of the line currently under the cursor? #239

Closed AmagicalFishy closed 5 months ago

AmagicalFishy commented 1 year ago

Everything works great except I'm unable to find a way of looking at what error is under my cursor. Even with document_diagnostics mode, if I'm hovering over a line that Trouble is identifying as having an error, it'll scroll me back up to the top of the page and start at the first error of the document.

Ideally, what I'd like is for the Trouble panel to be open all the time, display only the error that I'm hovering over, and be empty otherwise. If this isn't possible though, I'd really like to just be able to type in :Trouble [something] and see what the error I'm hovering over is.

How can I do this?

rkshthrmsh commented 1 year ago

Following. Really need this feature in nvim to work with ALE-like display of messages.

christopher-lawrence commented 1 year ago

It doesn't look like Trouble supports this, but you can use vim.diagnostic.open_float to do this.

Here is my keymap, hope it helps:

vim.keymap.set("n", "<leader>vd", vim.diagnostic.open_float, opts)
folke commented 5 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