Merge pull request #554 from AdaShoelace/main

Don't rename 'unnamed' tabs upon deletion of other tabs
This commit is contained in:
a-kenji 2021-06-01 10:23:02 +02:00 committed by GitHub
commit 26f499bbbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -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)");
}

View file

@ -255,6 +255,13 @@ impl Tab {
} else {
BTreeMap::new()
};
let name = if name.is_empty() {
format!("Tab #{}", position + 1)
} else {
name
};
Tab {
index,
position,