hover.nvim icon indicating copy to clipboard operation
hover.nvim copied to clipboard

feat: add multiple_hover config option

Open AThePeanut4 opened this issue 9 months ago • 4 comments

This adds a multiple_hover config option to configure what happens when hover() is called while a popup window is already open. This allows for a solution to #49 while retaining the current behaviour of cycling providers for those that prefer that. It is also once again possible to move the popup to a preview_window by using this option.

Also, when hover() is called while the cursor is inside the popup window, it will always cycle the providers.

I ended up rewriting a fair bit of the main popup logic while fixing a bunch of corner-case issues I found, I'd like to think it's simpler now than it was before. If you need explanations for why I made some specific change then feel free to ask.

The close() function no longer requires a bufnr argument, which I believe means #36 can be closed. This is possible because the winid of the popup window is now stored in a Lua "global" variable rather than in a Vim buffer-local variable. It was never really possible for multiple hover popups to be open simultaneously anyway.

And then I've added an .editorconfig file and formatted everything so that the indentation and ' usage is consistent. I'm happy to split that into another PR or revert it completely if needed.

Resolves #19 Resolves #36 Resolves #49 Resolves #64 Resolves #65

AThePeanut4 avatar Apr 30 '24 21:04 AThePeanut4

@lewis6991 I understand this is a large PR, and would be non-trivial to review, but do you plan on merging it at some point? If the feature is not something you are interested in adding, that's also perfectly fine - I'd just like to know.

AThePeanut4 avatar Jun 04 '24 22:06 AThePeanut4

This PR is unreviewable and contains lots of unrelated changes so I don't plan on merging.

lewis6991 avatar Jun 04 '24 22:06 lewis6991

@lewis6991 Thank you for letting me know.

If I split it up into many small commits, would that help? Or do you want multiple PRs?

Or would you not merge either way? I don't want to waste my time unnecessarily.

Thanks

AThePeanut4 avatar Jun 04 '24 22:06 AThePeanut4

Multiple PRs please. I haven't got time to review big changes. Haven't decided whether to merge the main change without reviewing first.

lewis6991 avatar Jun 04 '24 22:06 lewis6991