Skip to content
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

Merged
merged 3 commits into from
Jun 20, 2021

Conversation

vv9k
Copy link
Contributor

@vv9k vv9k commented Jun 20, 2021

Closes: #307

image

@archseer
Copy link
Member

Neat! Did you test that it works correctly with splits? A vertical split for example

@vv9k
Copy link
Contributor Author

vv9k commented Jun 20, 2021

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.

@vv9k
Copy link
Contributor Author

vv9k commented Jun 20, 2021

Now it correctly displays even with splits.

Edit: I still found a split configuration where it doesn't work, so this needs an update

@@ -434,6 +434,10 @@ impl Tree {
self.focus = key;
}
}

pub fn full_area(&self) -> Rect {
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, done.

@vv9k
Copy link
Contributor Author

vv9k commented Jun 20, 2021

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.

@archseer archseer merged commit fc39a6c into helix-editor:master Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pop-up documentation should not block the view to the cursor
2 participants