From 7cdf70281941ae262fcec29dee3592bc0a4c3777 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 c23daf22961e8c24f638cbf03613350334258938..154d27ff7754ba680266726224912efa5c93ddf7 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;