1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 13:52:55 +03:00

fix subtraction underflow in debug mode

This commit is contained in:
Wez Furlong 2019-12-09 21:52:36 -08:00
parent aed75850c5
commit 9a653ca663

View File

@ -61,7 +61,8 @@ impl TabBarState {
let titles_len: usize = tab_titles.iter().map(|s| unicode_column_width(s)).sum();
let number_of_tabs = tab_titles.len();
let available_cells = title_width - ((number_of_tabs * per_tab_overhead) + system_overhead);
let available_cells =
title_width.saturating_sub((number_of_tabs * per_tab_overhead) + system_overhead);
let tab_width_max = if available_cells >= titles_len {
// We can render each title with its full width
usize::max_value()