Fix PageUp for context menu (#13593)

The PageUp key was not working for the context menu. Instead of
selecting one of the previous items in the context menu, `MovePageUp`
closed the menu and scrolled the editor. `MovePageDown` was working
correctly because it has the same fix.



Release Notes:

- Fixed `pageup` key, when bound to `editor::MovePageUp`, not moving context menus as other keys
This commit is contained in:
Aleksei Gusev 2024-06-28 12:03:30 +03:00 committed by GitHub
parent 00d1561156
commit 6e1b99b039
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6812,6 +6812,16 @@ impl Editor {
return;
}
if self
.context_menu
.write()
.as_mut()
.map(|menu| menu.select_first(self.project.as_ref(), cx))
.unwrap_or(false)
{
return;
}
if matches!(self.mode, EditorMode::SingleLine { .. }) {
cx.propagate();
return;