Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Rename "CloseInactiveItems" action to "CloseOtherItems" (#34676)
Danilo Lealc287397a18e3
diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.jsonindex ebc88ec135e..b859d2d84c9 100644--- a/assets/keymaps/default-linux.json+++ b/assets/keymaps/default-linux.json@@ -419,7 +419,7 @@"ctrl-shift-pagedown": "pane::SwapItemRight","ctrl-f4": ["pane::CloseActiveItem", { "close_pinned": false }],"ctrl-w": ["pane::CloseActiveItem", { "close_pinned": false }],- "alt-ctrl-t": ["pane::CloseInactiveItems", { "close_pinned": false }],+ "alt-ctrl-t": ["pane::CloseOtherItems", { "close_pinned": false }],"alt-ctrl-shift-w": "workspace::CloseInactiveTabsAndPanes","ctrl-k e": ["pane::CloseItemsToTheLeft", { "close_pinned": false }],"ctrl-k t": ["pane::CloseItemsToTheRight", { "close_pinned": false }],diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.jsonindex cec485ce883..748deaa05d5 100644--- a/assets/keymaps/default-macos.json+++ b/assets/keymaps/default-macos.json@@ -477,7 +477,7 @@"ctrl-shift-pageup": "pane::SwapItemLeft","ctrl-shift-pagedown": "pane::SwapItemRight","cmd-w": ["pane::CloseActiveItem", { "close_pinned": false }],- "alt-cmd-t": ["pane::CloseInactiveItems", { "close_pinned": false }],+ "alt-cmd-t": ["pane::CloseOtherItems", { "close_pinned": false }],"ctrl-alt-cmd-w": "workspace::CloseInactiveTabsAndPanes","cmd-k e": ["pane::CloseItemsToTheLeft", { "close_pinned": false }],"cmd-k t": ["pane::CloseItemsToTheRight", { "close_pinned": false }],diff --git a/assets/keymaps/linux/emacs.json b/assets/keymaps/linux/emacs.jsonindex 0c633efabee..0ff3796f03d 100755--- a/assets/keymaps/linux/emacs.json+++ b/assets/keymaps/linux/emacs.json@@ -114,7 +114,7 @@"ctrl-x o": "workspace::ActivateNextPane", // other-window"ctrl-x k": "pane::CloseActiveItem", // kill-buffer"ctrl-x 0": "pane::CloseActiveItem", // delete-window- "ctrl-x 1": "pane::CloseInactiveItems", // delete-other-windows+ "ctrl-x 1": "pane::CloseOtherItems", // delete-other-windows"ctrl-x 2": "pane::SplitDown", // split-window-below"ctrl-x 3": "pane::SplitRight", // split-window-right"ctrl-x ctrl-f": "file_finder::Toggle", // find-filediff --git a/assets/keymaps/macos/emacs.json b/assets/keymaps/macos/emacs.jsonindex 0c633efabee..0ff3796f03d 100755--- a/assets/keymaps/macos/emacs.json+++ b/assets/keymaps/macos/emacs.json@@ -114,7 +114,7 @@"ctrl-x o": "workspace::ActivateNextPane", // other-window"ctrl-x k": "pane::CloseActiveItem", // kill-buffer"ctrl-x 0": "pane::CloseActiveItem", // delete-window- "ctrl-x 1": "pane::CloseInactiveItems", // delete-other-windows+ "ctrl-x 1": "pane::CloseOtherItems", // delete-other-windows"ctrl-x 2": "pane::SplitDown", // split-window-below"ctrl-x 3": "pane::SplitRight", // split-window-right"ctrl-x ctrl-f": "file_finder::Toggle", // find-filediff --git a/crates/collab/src/tests/following_tests.rs b/crates/collab/src/tests/following_tests.rsindex 3aa86a434da..1a4c3a70a4c 100644--- a/crates/collab/src/tests/following_tests.rs+++ b/crates/collab/src/tests/following_tests.rs@@ -1013,7 +1013,7 @@ async fn test_peers_following_each_other(cx_a: &mut TestAppContext, cx_b: &mut T// and some of which were originally opened by client B.workspace_b.update_in(cx_b, |workspace, window, cx| {workspace.active_pane().update(cx, |pane, cx| {- pane.close_inactive_items(&Default::default(), None, window, cx)+ pane.close_other_items(&Default::default(), None, window, cx).detach();});});diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rsindex 43c9c0db659..4efb052c71d 100644--- a/crates/editor/src/editor_tests.rs+++ b/crates/editor/src/editor_tests.rs@@ -55,7 +55,7 @@ use util::{uri,};use workspace::{- CloseActiveItem, CloseAllItems, CloseInactiveItems, MoveItemToPaneInDirection, NavigationEntry,+ CloseActiveItem, CloseAllItems, CloseOtherItems, MoveItemToPaneInDirection, NavigationEntry,OpenOptions, ViewId,item::{FollowEvent, FollowableItem, Item, ItemHandle, SaveOptions},};@@ -21463,7 +21463,7 @@ println!("5");.unwrap();pane_1.update_in(cx, |pane, window, cx| {- pane.close_inactive_items(&CloseInactiveItems::default(), None, window, cx)+ pane.close_other_items(&CloseOtherItems::default(), None, window, cx)}).await.unwrap();@@ -21499,7 +21499,7 @@ println!("5");.unwrap();pane_2.update_in(cx, |pane, window, cx| {- pane.close_inactive_items(&CloseInactiveItems::default(), None, window, cx)+ pane.close_other_items(&CloseOtherItems::default(), None, window, cx)}).await.unwrap();diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rsindex 74aed815a2a..23e04cae2c1 100644--- a/crates/vim/src/command.rs+++ b/crates/vim/src/command.rs@@ -1085,12 +1085,12 @@ fn generate_commands(_: &App) -> Vec<VimCommand> {),VimCommand::new(("tabo", "nly"),- workspace::CloseInactiveItems {+ workspace::CloseOtherItems {save_intent: Some(SaveIntent::Close),close_pinned: false,},)- .bang(workspace::CloseInactiveItems {+ .bang(workspace::CloseOtherItems {save_intent: Some(SaveIntent::Skip),close_pinned: false,}),diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rsindex 19afd49848d..7cc10c27f71 100644--- a/crates/workspace/src/pane.rs+++ b/crates/workspace/src/pane.rs@@ -116,7 +116,8 @@ pub struct CloseActiveItem {#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]#[action(namespace = pane)]#[serde(deny_unknown_fields)]-pub struct CloseInactiveItems {+#[action(deprecated_aliases = ["pane::CloseInactiveItems"])]+pub struct CloseOtherItems {#[serde(default)]pub save_intent: Option<SaveIntent>,#[serde(default)]@@ -1354,9 +1355,9 @@ impl Pane {})}- pub fn close_inactive_items(+ pub fn close_other_items(&mut self,- action: &CloseInactiveItems,+ action: &CloseOtherItems,target_item_id: Option<EntityId>,window: &mut Window,cx: &mut Context<Self>,@@ -2578,7 +2579,7 @@ impl Pane {save_intent: None,close_pinned: true,};- let close_inactive_items_action = CloseInactiveItems {+ let close_inactive_items_action = CloseOtherItems {save_intent: None,close_pinned: false,};@@ -2610,7 +2611,7 @@ impl Pane {.action(Box::new(close_inactive_items_action.clone())).disabled(total_items == 1).handler(window.handler_for(&pane, move |pane, window, cx| {- pane.close_inactive_items(+ pane.close_other_items(&close_inactive_items_action,Some(item_id),window,@@ -3521,8 +3522,8 @@ impl Render for Pane {}),).on_action(- cx.listener(|pane: &mut Self, action: &CloseInactiveItems, window, cx| {- pane.close_inactive_items(action, None, window, cx)+ cx.listener(|pane: &mut Self, action: &CloseOtherItems, window, cx| {+ pane.close_other_items(action, None, window, cx).detach_and_log_err(cx);}),)@@ -5853,8 +5854,8 @@ mod tests {assert_item_labels(&pane, ["A!", "B!", "C", "D", "E*"], cx);pane.update_in(cx, |pane, window, cx| {- pane.close_inactive_items(- &CloseInactiveItems {+ pane.close_other_items(+ &CloseOtherItems {save_intent: None,close_pinned: false,},@@ -5890,8 +5891,8 @@ mod tests {assert_item_labels(&pane, ["A", "B", "C", "D", "E*"], cx);pane.update_in(cx, |pane, window, cx| {- pane.close_inactive_items(- &CloseInactiveItems {+ pane.close_other_items(+ &CloseOtherItems {save_intent: None,close_pinned: false,},@@ -6256,8 +6257,8 @@ mod tests {.unwrap();pane.update_in(cx, |pane, window, cx| {- pane.close_inactive_items(- &CloseInactiveItems {+ pane.close_other_items(+ &CloseOtherItems {save_intent: None,close_pinned: false,},diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rsindex be5d693d356..f37abe59e24 100644--- a/crates/workspace/src/workspace.rs+++ b/crates/workspace/src/workspace.rs@@ -2793,8 +2793,8 @@ impl Workspace {if retain_active_pane {let current_pane_close = current_pane.update(cx, |pane, cx| {- pane.close_inactive_items(- &CloseInactiveItems {+ pane.close_other_items(+ &CloseOtherItems {save_intent: None,close_pinned: false,},@@ -9471,8 +9471,8 @@ mod tests {);});let close_all_but_multi_buffer_task = pane.update_in(cx, |pane, window, cx| {- pane.close_inactive_items(- &CloseInactiveItems {+ pane.close_other_items(+ &CloseOtherItems {save_intent: Some(SaveIntent::Save),close_pinned: true,},