From 1044b7d7d2b81e6e311b08284edbd7e336b92b95 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Tue, 9 Aug 2022 16:15:53 -0700 Subject: [PATCH 1/4] checkpoint, no idea what's happening --- crates/gpui/src/platform/mac/window.rs | 6 +++++- crates/terminal/src/mappings/keys.rs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs index 908efd451cf1fa79765e1ccd2c7f98730e8b044f..0aba30dd6d52b0aa66ab320fbb8aad2d332a8332 100644 --- a/crates/gpui/src/platform/mac/window.rs +++ b/crates/gpui/src/platform/mac/window.rs @@ -292,6 +292,7 @@ struct WindowState { previous_modifiers_changed_event: Option, } +#[derive(Debug)] struct InsertText { replacement_range: Option>, text: String, @@ -742,6 +743,8 @@ extern "C" fn handle_key_event(this: &Object, native_event: id, key_equivalent: let function_is_held; window_state_borrow.pending_key_down = match event { Event::KeyDown(event) => { + dbg!(&event); + let keydown = event.keystroke.clone(); // Ignore events from held-down keys after some of the initially-pressed keys // were released. @@ -752,12 +755,12 @@ extern "C" fn handle_key_event(this: &Object, native_event: id, key_equivalent: } else { window_state_borrow.last_fresh_keydown = Some(keydown); } - function_is_held = event.keystroke.function; Some((event, None)) } _ => return NO, }; + drop(window_state_borrow); if !function_is_held { @@ -782,6 +785,7 @@ extern "C" fn handle_key_event(this: &Object, native_event: id, key_equivalent: } if !handled { + println!("not handling, {:?}", insert_text); if let Some(insert) = insert_text { handled = true; with_input_handler(this, |input_handler| { diff --git a/crates/terminal/src/mappings/keys.rs b/crates/terminal/src/mappings/keys.rs index 215bfe1ad983770c1c14116f9f2380bbfee4fe6f..6389bf6a10a198937cf3e0017696732c5eacd22b 100644 --- a/crates/terminal/src/mappings/keys.rs +++ b/crates/terminal/src/mappings/keys.rs @@ -243,7 +243,7 @@ pub fn to_esc_str(keystroke: &Keystroke, mode: &TermMode) -> Option { } } - None + Some(keystroke.key.to_string()) } /// Code Modifiers From e2200109e61ee3f821aa746463e25cf3cb25c58d Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Thu, 11 Aug 2022 15:47:56 -0700 Subject: [PATCH 2/4] Make clippy happy --- crates/gpui/src/platform/mac/window.rs | 4 ---- crates/terminal/src/mappings/keys.rs | 2 +- styles/package-lock.json | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs index 35eacb6f6875a10217518ce54bfa8ab2b180991f..60b079c266664d80375ae55705b752fe03306e8a 100644 --- a/crates/gpui/src/platform/mac/window.rs +++ b/crates/gpui/src/platform/mac/window.rs @@ -301,7 +301,6 @@ struct WindowState { previous_modifiers_changed_event: Option, } -#[derive(Debug)] struct InsertText { replacement_range: Option>, text: String, @@ -757,8 +756,6 @@ extern "C" fn handle_key_event(this: &Object, native_event: id, key_equivalent: let function_is_held; window_state_borrow.pending_key_down = match event { Event::KeyDown(event) => { - dbg!(&event); - let keydown = event.keystroke.clone(); // Ignore events from held-down keys after some of the initially-pressed keys // were released. @@ -799,7 +796,6 @@ extern "C" fn handle_key_event(this: &Object, native_event: id, key_equivalent: } if !handled { - println!("not handling, {:?}", insert_text); if let Some(insert) = insert_text { handled = true; with_input_handler(this, |input_handler| { diff --git a/crates/terminal/src/mappings/keys.rs b/crates/terminal/src/mappings/keys.rs index b71aa0d3128a0f87ef72bcf2ab5e0ee7ed392fcd..e07a3249984d07502e59ad473ba7f6e3f6d4b522 100644 --- a/crates/terminal/src/mappings/keys.rs +++ b/crates/terminal/src/mappings/keys.rs @@ -243,7 +243,7 @@ pub fn to_esc_str(keystroke: &Keystroke, mode: &TermMode) -> Option { } } - Some(keystroke.key.to_string()) + None } /// Code Modifiers diff --git a/styles/package-lock.json b/styles/package-lock.json index 582f1c84968a5c1a25ddac5fd3c21ba907353c6d..5499f1852cb4330467268dee6436b53589a90e9b 100644 --- a/styles/package-lock.json +++ b/styles/package-lock.json @@ -5,7 +5,6 @@ "requires": true, "packages": { "": { - "name": "styles", "version": "1.0.0", "license": "ISC", "dependencies": { From 45c7c32a0a0f76bc5a150975f356db559b0c2001 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Thu, 11 Aug 2022 19:29:52 -0700 Subject: [PATCH 3/4] Test --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 31cfdcbd7fb5002926a47e704c76ddd464e5a7e9..2cda4fb3a76e0168e6376fe2f88d46b95ad37e40 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI](https://github.com/zed-industries/zed/actions/workflows/ci.yml/badge.svg)](https://github.com/zed-industries/zed/actions/workflows/ci.yml) -Welcome to Zed, a lightning-fast, collaborative code editor that makes your dreams come true. +Welcome to Zed, a lightning-fast, collaborative code editor that makes your dreams come true. ## Development tips From 683953083271e457b69344d5825627af798183d6 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Thu, 11 Aug 2022 19:32:47 -0700 Subject: [PATCH 4/4] remove clippy :( --- .github/workflows/ci.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d07b26ef84f5c527bdd908fdce249c3072c39bc..cef94970748e20fe6546dc1c05db5d6f32af4014 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,6 @@ jobs: run: | rustup set profile minimal rustup update stable - rustup component add clippy rustup target add wasm32-wasi - name: Install Node @@ -40,14 +39,6 @@ jobs: uses: actions/checkout@v2 with: clean: false - - - name: Run clippy - run: > - cargo clippy --workspace -- - -Dwarnings - -Aclippy::reversed_empty_ranges - -Aclippy::missing_safety_doc - -Aclippy::let_unit_value - name: Run tests run: cargo test --workspace --no-fail-fast