Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

macos: Keybind improvements for binds involving shift (#21207)

Peter Trippfdc17c57d71d
diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json
index c8bc80a9c03..ddbbdd3faf5 100644
--- a/assets/keymaps/default-macos.json
+++ b/assets/keymaps/default-macos.json
@@ -355,7 +355,7 @@
"alt-cmd-f12": "editor::GoToTypeDefinitionSplit",
"alt-shift-f12": "editor::FindAllReferences",
"ctrl-m": "editor::MoveToEnclosingBracket",
- "cmd-shift-\\": "editor::MoveToEnclosingBracket",
+ "cmd-|": "editor::MoveToEnclosingBracket",
"alt-cmd-[": "editor::Fold",
"alt-cmd-]": "editor::UnfoldLines",
"cmd-k cmd-l": "editor::ToggleFold",
diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs
index 5ba63b9c1f7..4e3d05d2fba 100644
--- a/crates/zed/src/zed.rs
+++ b/crates/zed/src/zed.rs
@@ -3190,12 +3190,7 @@ mod tests {
.fs
.save(
"/settings.json".as_ref(),
- &r#"
- {
- "base_keymap": "Atom"
- }
- "#
- .into(),
+ &r#"{"base_keymap": "Atom"}"#.into(),
Default::default(),
)
.await
@@ -3205,16 +3200,7 @@ mod tests {
.fs
.save(
"/keymap.json".as_ref(),
- &r#"
- [
- {
- "bindings": {
- "backspace": "test1::A"
- }
- }
- ]
- "#
- .into(),
+ &r#"[{"bindings": {"backspace": "test1::A"}}]"#.into(),
Default::default(),
)
.await
@@ -3257,16 +3243,7 @@ mod tests {
.fs
.save(
"/keymap.json".as_ref(),
- &r#"
- [
- {
- "bindings": {
- "backspace": "test1::B"
- }
- }
- ]
- "#
- .into(),
+ &r#"[{"bindings": {"backspace": "test1::B"}}]"#.into(),
Default::default(),
)
.await
@@ -3286,12 +3263,7 @@ mod tests {
.fs
.save(
"/settings.json".as_ref(),
- &r#"
- {
- "base_keymap": "JetBrains"
- }
- "#
- .into(),
+ &r#"{"base_keymap": "JetBrains"}"#.into(),
Default::default(),
)
.await
@@ -3318,24 +3290,20 @@ mod tests {
// From the Atom keymap
use workspace::ActivatePreviousPane;
// From the JetBrains keymap
- use pane::ActivatePrevItem;
+ use diagnostics::Deploy;
+
workspace
.update(cx, |workspace, _| {
- workspace
- .register_action(|_, _: &A, _| {})
- .register_action(|_, _: &B, _| {});
+ workspace.register_action(|_, _: &A, _cx| {});
+ workspace.register_action(|_, _: &B, _cx| {});
+ workspace.register_action(|_, _: &Deploy, _cx| {});
})
.unwrap();
app_state
.fs
.save(
"/settings.json".as_ref(),
- &r#"
- {
- "base_keymap": "Atom"
- }
- "#
- .into(),
+ &r#"{"base_keymap": "Atom"}"#.into(),
Default::default(),
)
.await
@@ -3344,16 +3312,7 @@ mod tests {
.fs
.save(
"/keymap.json".as_ref(),
- &r#"
- [
- {
- "bindings": {
- "backspace": "test2::A"
- }
- }
- ]
- "#
- .into(),
+ &r#"[{"bindings": {"backspace": "test2::A"}}]"#.into(),
Default::default(),
)
.await
@@ -3391,16 +3350,7 @@ mod tests {
.fs
.save(
"/keymap.json".as_ref(),
- &r#"
- [
- {
- "bindings": {
- "backspace": null
- }
- }
- ]
- "#
- .into(),
+ &r#"[{"bindings": {"backspace": null}}]"#.into(),
Default::default(),
)
.await
@@ -3420,12 +3370,7 @@ mod tests {
.fs
.save(
"/settings.json".as_ref(),
- &r#"
- {
- "base_keymap": "JetBrains"
- }
- "#
- .into(),
+ &r#"{"base_keymap": "JetBrains"}"#.into(),
Default::default(),
)
.await
@@ -3433,12 +3378,7 @@ mod tests {
cx.background_executor.run_until_parked();
- assert_key_bindings_for(
- workspace.into(),
- cx,
- vec![("[", &ActivatePrevItem)],
- line!(),
- );
+ assert_key_bindings_for(workspace.into(), cx, vec![("6", &Deploy)], line!());
}
#[gpui::test]