soulis-1256 / eagle.nvim

Show diagnostics and lsp info inside a custom window
Apache License 2.0
245 stars 5 forks source link

Feat: Dynamically flip diagnostics and lspinfo order when displayed above/below row #23

Open GNRSN opened 1 day ago

GNRSN commented 1 day ago

Thanks for the great plugin! Been looking for a combined diagnostics and hover UI since swapping to nvim.

After about a week of usage I've found myself being confused when hovering an item with diagnostics, whilst actually looking for the lsp info. When the ui opens above the line the lsp-info is just next to the target, which I'm used to from previous hovers, but when it opens bellow the line, the lsp info is at the bottom, possibly quite a few lines down since diagnostic is always >= 4 rows high.

I think flipping the sections dynamically would make the the hover more predictable/easy to read.

I assume this would have to be configurable by a setting for users who prefer the existing behavior.

soulis-1256 commented 1 day ago

@GNRSN Hi, can you provide an example? Ideally screenshots or even a quick video. I don't think what you described is supposed to be desired behavior.

GNRSN commented 1 day ago

Above cursor/line

image

Below cursor/line

image

The hover window contents are always "sorted" by diagnostic first and then lsp info. What I'm asking for is to "flip" these when positioned below so that is possible to expect the lsp-info closest to the cursor.

GNRSN commented 1 day ago

Here is a photobash of how I would have expeced the result to look:

image
soulis-1256 commented 1 day ago

Oh, I understand now. That should be as simple as adding a config option. I'll get to it soon.