Skip to content

Commit

Permalink
Set tab name on creation instead of on render
Browse files Browse the repository at this point in the history
  • Loading branch information
AdaShoelace committed May 31, 2021
1 parent 9cbe410 commit b3e9dda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 1 addition & 5 deletions default-plugins/tab-bar/src/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
}
Expand Down
6 changes: 5 additions & 1 deletion zellij-server/src/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ impl Tab {
index,
position,
panes,
name,
name: if name.is_empty() {
format!("Tab #{} (unnamed)", position + 1)
} else {
name
},
max_panes,
panes_to_hide: HashSet::new(),
active_terminal: pane_id,
Expand Down

0 comments on commit b3e9dda

Please sign in to comment.