This commit is contained in:
Kovid Goyal 2021-10-14 09:57:35 +05:30
parent 533b0ed591
commit 67fd07a92a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -561,7 +561,8 @@ class TabBar:
del self.screen
def tab_at(self, x: int) -> Optional[int]:
x = (x - self.window_geometry.left) // self.cell_width
for i, (a, b) in enumerate(self.cell_ranges):
if a <= x <= b:
return i
if self.laid_out_once:
x = (x - self.window_geometry.left) // self.cell_width
for i, (a, b) in enumerate(self.cell_ranges):
if a <= x <= b:
return i