From 6e1b99b03935922511cdf01978f24abedd0d1868 Mon Sep 17 00:00:00 2001 From: Aleksei Gusev Date: Fri, 28 Jun 2024 12:03:30 +0300 Subject: [PATCH] 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 --- crates/editor/src/editor.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 18289a98519a8575f826ceef29eb5304c07c3a98..7ca6af8008ba6b917cf895a36dab821768348e10 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -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;