When completions menu is displayed above cursor, reverse order (#23446)

Considered doing this when previously working on completions menu
layout, as it brings the default selection position next to the cursor
position, and is generally more symmetrical. With #23445 there is now a
more compelling reason, as the "translucent, cropped bottom" display
doesn't make sense when displayed above.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-01-21 22:47:56 -07:00 committed by GitHub
parent 1769bc957b
commit 2f1af2ab69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 163 additions and 56 deletions

View file

@ -5246,11 +5246,12 @@ impl Editor {
&self,
style: &EditorStyle,
max_height_in_lines: u32,
y_flipped: bool,
cx: &mut ViewContext<Editor>,
) -> Option<AnyElement> {
self.context_menu.borrow().as_ref().and_then(|menu| {
if menu.visible() {
Some(menu.render(style, max_height_in_lines, cx))
Some(menu.render(style, max_height_in_lines, y_flipped, cx))
} else {
None
}