From 0d87b8fac5168171493cb0d8cef85d60e564c0b0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 24 Mar 2020 16:05:02 +0530 Subject: [PATCH] Fix a regression in 0.17 that caused tab bar background to be rendered after the last tab as well Fixes #2464 --- docs/changelog.rst | 3 +++ kitty/tab_bar.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 3bd8e3579..e5f189f2b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -9,6 +9,9 @@ To update |kitty|, :doc:`follow the instructions `. - 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 0.17.0 [2020-03-24] diff --git a/kitty/tab_bar.py b/kitty/tab_bar.py index 1b111eaa0..3d97741b9 100644 --- a/kitty/tab_bar.py +++ b/kitty/tab_bar.py @@ -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: + 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: screen.draw(' ' * draw_data.leading_spaces) 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(' ') start_draw = 1 + screen.cursor.bg = tab_bg if min_title_length >= max_title_length: screen.draw('…') else: @@ -179,7 +182,7 @@ class TabBar: s.color_profile.update_ansi_color_table(build_ansi_color_table(opts)) s.color_profile.set_configured_colors( color_as_int(opts.inactive_tab_foreground), - color_as_int(opts.inactive_tab_background) + color_as_int(opts.background) ) self.blank_rects: Tuple[Rect, ...] = () sep = opts.tab_separator