Fix a regression in the previous release that broke active_tab_foreground

Fixes #4620
This commit is contained in:
Kovid Goyal
2022-02-03 18:12:42 +05:30
parent 6fa4110da9
commit 34a0218f35
4 changed files with 9 additions and 4 deletions

View File

@@ -75,6 +75,11 @@ command.
Detailed list of changes Detailed list of changes
------------------------------------- -------------------------------------
0.24.3 [future]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Fix a regression in the previous release that broke :opt:`active_tab_foreground` (:iss:`4620`)
0.24.2 [2022-02-03] 0.24.2 [2022-02-03]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -1064,7 +1064,7 @@ surround the text with quotes. See :opt:`tab_title_template` for how this is ren
''' '''
) )
opt('tab_title_template', '"{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.default}{title}"', opt('tab_title_template', '"{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}"',
option_type='tab_title_template', option_type='tab_title_template',
long_text=''' long_text='''
A template to render the tab title. The default just renders the title with optional symbols for bell and activity. A template to render the tab title. The default just renders the title with optional symbols for bell and activity.
@@ -1079,7 +1079,7 @@ is done by Python's string formatting machinery, so you can use, for instance,
:code:`{layout_name[:2].upper()}` to show only the first two letters of the :code:`{layout_name[:2].upper()}` to show only the first two letters of the
layout name, upper-cased. If you want to style the text, you can use styling layout name, upper-cased. If you want to style the text, you can use styling
directives, for example: directives, for example:
:code:`{fmt.fg.red}red{fmt.fg.default}normal{fmt.bg._00FF00}green :code:`{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}green
bg{fmt.bg.tab}`. Similarly, for bold and italic: bg{fmt.bg.tab}`. Similarly, for bold and italic:
:code:`{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. :code:`{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`.
Note that for backward compatibility, if :code:`{bell_symbol}` or :code:`{activity_symbol}` Note that for backward compatibility, if :code:`{bell_symbol}` or :code:`{activity_symbol}`

View File

@@ -565,7 +565,7 @@ class Options:
tab_powerline_style: choices_for_tab_powerline_style = 'angled' tab_powerline_style: choices_for_tab_powerline_style = 'angled'
tab_separator: str = '' tab_separator: str = ''
tab_switch_strategy: choices_for_tab_switch_strategy = 'previous' tab_switch_strategy: choices_for_tab_switch_strategy = 'previous'
tab_title_template: str = '{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.default}{title}' tab_title_template: str = '{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}'
term: str = 'xterm-kitty' term: str = 'xterm-kitty'
touch_scroll_multiplier: float = 1.0 touch_scroll_multiplier: float = 1.0
update_check_interval: float = 24.0 update_check_interval: float = 24.0

View File

@@ -203,7 +203,7 @@ def draw_title(draw_data: DrawData, screen: Screen, tab: TabBarData, index: int)
if eval_locals['activity_symbol'] and not template_has_field(template, 'activity_symbol'): if eval_locals['activity_symbol'] and not template_has_field(template, 'activity_symbol'):
prefix += '{activity_symbol}' prefix += '{activity_symbol}'
if prefix: if prefix:
template = '{fmt.fg.red}' + prefix + '{fmt.fg.default}' + template template = '{fmt.fg.red}' + prefix + '{fmt.fg.tab}' + template
try: try:
title = eval(compile_template(template), {'__builtins__': {}}, eval_locals) title = eval(compile_template(template), {'__builtins__': {}}, eval_locals)
except Exception as e: except Exception as e: