Prevent super large tab margin widths from causing a crash

Fixes #2793
This commit is contained in:
Kovid Goyal 2020-06-24 22:56:54 +05:30
parent d173ab9f45
commit 2b3753d99c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -261,7 +261,7 @@ class TabBar:
return
self.cell_width = cell_width
s = self.screen
viewport_width = tab_bar.width - 2 * self.margin_width
viewport_width = max(4 * cell_width, tab_bar.width - 2 * self.margin_width)
ncells = viewport_width // cell_width
s.resize(1, ncells)
s.reset_mode(DECAWM)