Bind autocomplete to ctrl-space

Nathan Sobo and Antonio Scandurra created

Co-Authored-By: Antonio Scandurra <me@as-cii.com>

Change summary

crates/editor/src/editor.rs           | 2 +-
crates/gpui/src/platform/mac/event.rs | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)

Detailed changes

crates/editor/src/editor.rs 🔗

@@ -225,7 +225,7 @@ pub fn init(cx: &mut MutableAppContext, path_openers: &mut Vec<Box<dyn PathOpene
         Binding::new("alt-cmd-[", Fold, Some("Editor")),
         Binding::new("alt-cmd-]", Unfold, Some("Editor")),
         Binding::new("alt-cmd-f", FoldSelectedRanges, Some("Editor")),
-        Binding::new("ctrl-shift-A", ShowAutocomplete, Some("Editor")),
+        Binding::new("ctrl-space", ShowAutocomplete, Some("Editor")),
     ]);
 
     cx.add_action(Editor::open_new);

crates/gpui/src/platform/mac/event.rs 🔗

@@ -34,9 +34,11 @@ impl Event {
                     const ESCAPE_KEY: u16 = 0x1b;
                     const TAB_KEY: u16 = 0x09;
                     const SHIFT_TAB_KEY: u16 = 0x19;
+                    const SPACE_KEY: u16 = b' ' as u16;
 
                     #[allow(non_upper_case_globals)]
                     match first_char as u16 {
+                        SPACE_KEY => "space",
                         BACKSPACE_KEY => "backspace",
                         ENTER_KEY => "enter",
                         ESCAPE_KEY => "escape",