-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make completion window move to top when cursor is below half #322
Conversation
Neat! Did you test that it works correctly with splits? A vertical split for example |
Vertical does seem to work, but with horizontal it is still displayed on the bottom. I will push a fix soon. Edit: Actually rethinking it now, it might not be as trivial to determine whether the cursor is below half of screen. I will have to dig some more. |
Now it correctly displays even with splits. Edit: I still found a split configuration where it doesn't work, so this needs an update |
helix-view/src/tree.rs
Outdated
@@ -434,6 +434,10 @@ impl Tree { | |||
self.focus = key; | |||
} | |||
} | |||
|
|||
pub fn full_area(&self) -> Rect { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call it either area or viewport to match terminology elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, done.
I'm pretty sure it works as expected now, done tests with multiple split confiurations and it is correctly either displayed on top or bottom so that the cursor is always visible. |
Closes: #307