feat: add multiple_hover config option #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a
multiple_hover
config option to configure what happens whenhover()
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 apreview_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