Fix completions menu scroll when y_flipped and edit prediction arrives (#23580)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-01-27 00:36:21 -07:00 committed by GitHub
parent 9cae96f82f
commit 6e9ea47849
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -871,8 +871,9 @@ impl CompletionsMenu {
};
entries.extend(matches.into_iter().map(CompletionEntry::Match));
self.selected_item = new_selection;
self.scroll_handle
.scroll_to_item(new_selection, ScrollStrategy::Top);
// Scroll to 0 even if the LSP completion is the only one selected. This keeps the display
// consistent when y_flipped.
self.scroll_handle.scroll_to_item(0, ScrollStrategy::Top);
}
}