summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-06-01 10:23:02 +0200
committerGitHub <noreply@github.com>2021-06-01 10:23:02 +0200
commit26f499bbbbbc400e058d82f91c88f4ecb8aea1c9 (patch)
tree0c54b33825bf68ee1d28db341aa0503ef5b33876
parentc787cea9e01be50f16d939c7073709ab01d9a321 (diff)
parenta2efc6fcac3be363acdbb92ca55ea80b424221e2 (diff)
Merge pull request #554 from AdaShoelace/main
Don't rename 'unnamed' tabs upon deletion of other tabs
-rw-r--r--default-plugins/tab-bar/src/tab.rs6
-rw-r--r--zellij-server/src/tab.rs7
2 files changed, 8 insertions, 5 deletions
diff --git a/default-plugins/tab-bar/src/tab.rs b/default-plugins/tab-bar/src/tab.rs
index fb8e377d1..7e83e85bb 100644
--- a/default-plugins/tab-bar/src/tab.rs
+++ b/default-plugins/tab-bar/src/tab.rs
@@ -46,11 +46,7 @@ pub fn tab_style(
capabilities: PluginCapabilities,
) -> LinePart {
let separator = tab_separator(capabilities);
- let mut tab_text = if text.is_empty() {
- format!("Tab #{}", position + 1)
- } else {
- text
- };
+ let mut tab_text = text;
if is_sync_panes_active {
tab_text.push_str(" (Sync)");
}
diff --git a/zellij-server/src/tab.rs b/zellij-server/src/tab.rs
index 7daf20925..e1bbf2e54 100644
--- a/zellij-server/src/tab.rs
+++ b/zellij-server/src/tab.rs
@@ -255,6 +255,13 @@ impl Tab {
} else {
BTreeMap::new()
};
+
+ let name = if name.is_empty() {
+ format!("Tab #{}", position + 1)
+ } else {
+ name
+ };
+
Tab {
index,
position,