Open
Conversation
The border was not being factored in when deciding how to anchor the signature window, causing it to sometimes overlap the current line. Similarly, the border was not being considered when drawing the signature window above teh current line, causing it to be offset two lines away from the current line.
Previous fix for folke#1122 didn't handle the case where the hover window was still larger than the available space to display it. This fixes that case as well as correctly aligns hover when displaying to the left. Also use vim.go.lines instead of vim.fn.winheight to allow popups to overlap other windows. That seems like a better choice since it's a momentary popup vs making the popup potentially very small
I think I finally have position, padding, and border figured out. position is where you want the content to start, i.e. where the doc content begins borders and padding are drawn "before" that position (where what before means depends on anchoring) The code should now handle all position, padding, border combinations
Also remove debug notifs
|
<3 for relieving my headaches. until this gets merged - packer: |
Contributor
|
This PR is stale because it has been open 30 days with no activity. |
|
PR Labeler bot will ask you to rename this PR to something like:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The code to layout the lsp hover window was not handling a number of edge cases (anchoring E without a border, anchoring S and/or E with a border, and when hover window is too large to fit). These are all fixed and all combinations of position, padding, and border are handled correctly (afaik).
To fix all of these cases, we calculate position correctly, accounting for border and padding, and then set the maximum size accordingly.
Here are a bunch of screenshots to show the fixed layout:
No border:
Border:
Overlapping other windows:

Resizing (so window doesn't get pushed onto cursor line, last line is statusline):

Resizing with small window:


Unusual position, padding with border and large max_height:
Related Issue(s)
Fixes #1122
Screenshots