From fb8b9b3933c37379c64ad4d679c6c4b2d1f47c82 Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Fri, 1 Jan 2021 23:23:47 +0100 Subject: [PATCH 1/2] kitty/config_data: remove duplicate function selection_foreground() serves the exact same purpose as to_color_or_none() --- kitty/config_data.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/kitty/config_data.py b/kitty/config_data.py index 4eed7c9cf..ce0dd55d8 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -1025,14 +1025,7 @@ o('dim_opacity', 0.75, option_type=unit_float, long_text=_(''' How much to dim text that has the DIM/FAINT attribute set. One means no dimming and zero means fully dimmed (i.e. invisible).''')) - -def selection_foreground(x: str) -> Optional[Color]: - if x.lower() != 'none': - return to_color(x) - return None - - -o('selection_foreground', '#000000', option_type=selection_foreground, long_text=_(''' +o('selection_foreground', '#000000', option_type=to_color_or_none, long_text=_(''' The foreground for text selected with the mouse. A value of none means to leave the color unchanged.''')) o('selection_background', '#fffacd', option_type=to_color, long_text=_(''' The background for text selected with the mouse.''')) From dbe44c9e4bd2990ac5738593e2c9d4748489616f Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Fri, 1 Jan 2021 23:25:06 +0100 Subject: [PATCH 2/2] kitten/diff: allow specifying none color for select_fg Allow diff kitten to not override foreground color for selections. Related #1358 --- kittens/diff/config_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kittens/diff/config_data.py b/kittens/diff/config_data.py index 17c7af37f..bb02e6ec4 100644 --- a/kittens/diff/config_data.py +++ b/kittens/diff/config_data.py @@ -89,7 +89,7 @@ c('hunk_bg', '#f1f8ff') c('search_bg', '#444', long_text=_('Highlighting')) c('search_fg', 'white') c('select_bg', '#b4d5fe') -c('select_fg', 'black') +o('select_fg', 'black', option_type=to_color_or_none) g('shortcuts') k('quit', 'q', 'quit', _('Quit'))