Fix segfault when opening more tabs than would fit with even one character titles on the tab bar. Fixes #706

This commit is contained in:
Kovid Goyal
2018-07-07 05:35:56 +05:30
parent a239f41495
commit aeed20087e

View File

@@ -153,7 +153,7 @@ class TabBar:
s = self.screen
s.cursor.x = 0
s.erase_in_line(2, False)
max_title_length = (self.screen_geometry.xnum // max(1, len(data))) - 1
max_title_length = max(1, (self.screen_geometry.xnum // max(1, len(data))) - 1)
cr = []
last_tab = data[-1] if data else None