Use literal type for text_fg_override_threshold

This commit is contained in:
Kovid Goyal
2025-03-19 21:51:54 +05:30
parent 0db9b882fe
commit 1ba47749f4
2 changed files with 3 additions and 3 deletions

View File

@@ -614,7 +614,7 @@ class Options:
term: str = 'xterm-kitty'
terminfo_type: choices_for_terminfo_type = 'path'
text_composition_strategy: str = 'platform'
text_fg_override_threshold: tuple[float, str] = (0.0, '%')
text_fg_override_threshold: tuple[float, typing.Literal['%', 'ratio']] = (0.0, '%')
touch_scroll_multiplier: float = 1.0
transparent_background_colors: tuple[tuple[kitty.fast_data_types.Color, float], ...] = ()
undercurl_style: choices_for_undercurl_style = 'thin-sparse'

View File

@@ -753,8 +753,8 @@ def active_tab_title_template(x: str) -> str | None:
return None if x == 'none' else x
def text_fg_override_threshold(x: str) -> tuple[float, str]:
return number_with_unit(x, '%', 'ratio')
def text_fg_override_threshold(x: str) -> tuple[float, Literal['%', 'ratio']]:
return number_with_unit(x, '%', 'ratio') # type: ignore
ClearOn = Literal['next', 'focus']