Fix PageUp for context menu (#13593)

Aleksei Gusev created

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

Change summary

crates/editor/src/editor.rs | 10 ++++++++++
1 file changed, 10 insertions(+)

Detailed changes

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;