Fix a regression in 0.17 that caused tab bar background to be rendered after the last tab as well

Fixes #2464
This commit is contained in:
Kovid Goyal 2020-03-24 16:05:02 +05:30
parent 5227b1f98b
commit 0d87b8fac5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 1 deletions

View File

@ -9,6 +9,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Fix :opt:`cursor_underline_thickness` not working (:iss:`2465`) - Fix :opt:`cursor_underline_thickness` not working (:iss:`2465`)
- Fix a regression in 0.17 that caused tab bar background to be rendered after
the last tab as well (:iss:`2464`)
- :ref:`splits_layout` to arrange windows in arbitrary splits - :ref:`splits_layout` to arrange windows in arbitrary splits
0.17.0 [2020-03-24] 0.17.0 [2020-03-24]

View File

@ -66,6 +66,8 @@ def draw_title(draw_data: DrawData, screen: Screen, tab: TabBarData, index: int)
def draw_tab_with_separator(draw_data: DrawData, screen: Screen, tab: TabBarData, before: int, max_title_length: int, index: int, is_last: bool) -> int: def draw_tab_with_separator(draw_data: DrawData, screen: Screen, tab: TabBarData, before: int, max_title_length: int, index: int, is_last: bool) -> int:
tab_bg = draw_data.active_bg if tab.is_active else draw_data.inactive_bg
screen.cursor.bg = as_rgb(color_as_int(tab_bg))
if draw_data.leading_spaces: if draw_data.leading_spaces:
screen.draw(' ' * draw_data.leading_spaces) screen.draw(' ' * draw_data.leading_spaces)
draw_title(draw_data, screen, tab, index) draw_title(draw_data, screen, tab, index)
@ -138,6 +140,7 @@ def draw_tab_with_powerline(draw_data: DrawData, screen: Screen, tab: TabBarData
screen.draw(' ') screen.draw(' ')
start_draw = 1 start_draw = 1
screen.cursor.bg = tab_bg
if min_title_length >= max_title_length: if min_title_length >= max_title_length:
screen.draw('') screen.draw('')
else: else:
@ -179,7 +182,7 @@ class TabBar:
s.color_profile.update_ansi_color_table(build_ansi_color_table(opts)) s.color_profile.update_ansi_color_table(build_ansi_color_table(opts))
s.color_profile.set_configured_colors( s.color_profile.set_configured_colors(
color_as_int(opts.inactive_tab_foreground), color_as_int(opts.inactive_tab_foreground),
color_as_int(opts.inactive_tab_background) color_as_int(opts.background)
) )
self.blank_rects: Tuple[Rect, ...] = () self.blank_rects: Tuple[Rect, ...] = ()
sep = opts.tab_separator sep = opts.tab_separator