From e1ed9aca10b504d7334f386bbfc140c4afe2a60f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 7 Aug 2021 21:34:16 +0530 Subject: [PATCH] clear_all_mouse_shortcuts -> clear_all_mouse_actions --- docs/changelog.rst | 3 +++ kitty/config.py | 2 +- kitty/options/definition.py | 8 ++++---- kitty/options/parse.py | 8 ++++---- kitty/options/types.py | 4 ++-- kitty/options/utils.py | 2 +- kitty_tests/options.py | 2 +- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index d793a259f..d4335b29b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -32,6 +32,9 @@ To update |kitty|, :doc:`follow the instructions `. - terminfo: Fix "cnorm" the property for setting the cursor to normal using a solid block rather than a blinking block cursor (:iss:`3906`) +- Add :opt:`clear_all_mouse_actions` to clear all mouse actions defined to + that point (:iss:`3907`) + 0.22.2 [2021-08-02] ---------------------- diff --git a/kitty/config.py b/kitty/config.py index e895493b0..d07c65ab1 100644 --- a/kitty/config.py +++ b/kitty/config.py @@ -123,7 +123,7 @@ def finalize_keys(opts: Options) -> None: def finalize_mouse_mappings(opts: Options) -> None: defns: List[MouseMapping] = [] for d in opts.mouse_map: - if d is None: # clear_all_mouse_shortcuts + if d is None: # clear_all_mouse_actions defns = [] # type: ignore else: defns.append(d.resolve_and_copy(opts.kitty_mod, opts.kitten_alias)) diff --git a/kitty/options/definition.py b/kitty/options/definition.py index beb7d8cf2..b5b04c660 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -499,11 +499,11 @@ of URLs with a plain click:: automatically end it and no release event will be dispatched. ''') -opt('clear_all_mouse_shortcuts', 'no', - option_type='clear_all_mouse_shortcuts', +opt('clear_all_mouse_actions', 'no', + option_type='clear_all_mouse_actions', long_text=''' -You can have kitty remove all mouse shortcut definition seen up to this point. -Useful, for instance, to remove the default mouse shortcuts. +You can have kitty remove all mouse actions seen up to this point. +Useful, for instance, to remove the default mouse actions. ''' ) diff --git a/kitty/options/parse.py b/kitty/options/parse.py index 05d5cc60c..f0731585b 100644 --- a/kitty/options/parse.py +++ b/kitty/options/parse.py @@ -8,7 +8,7 @@ from kitty.conf.utils import ( ) from kitty.options.utils import ( active_tab_title_template, adjust_baseline, adjust_line_height, allow_hyperlinks, - allow_remote_control, box_drawing_scale, clear_all_mouse_shortcuts, clear_all_shortcuts, + allow_remote_control, box_drawing_scale, clear_all_mouse_actions, clear_all_shortcuts, clipboard_control, config_or_absolute_path, copy_on_select, cursor_text_color, deprecated_hide_window_decorations_aliases, deprecated_macos_show_window_title_in_menubar_alias, deprecated_send_text, disable_ligatures, edge_width, env, font_features, hide_window_decorations, @@ -90,12 +90,12 @@ class Parser: def box_drawing_scale(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['box_drawing_scale'] = box_drawing_scale(val) + def clear_all_mouse_actions(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: + clear_all_mouse_actions(val, ans) + def clear_all_shortcuts(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: clear_all_shortcuts(val, ans) - def clear_all_mouse_shortcuts(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: - clear_all_mouse_shortcuts(val, ans) - def click_interval(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['click_interval'] = float(val) diff --git a/kitty/options/types.py b/kitty/options/types.py index 95af7a7ae..919d04847 100644 --- a/kitty/options/types.py +++ b/kitty/options/types.py @@ -61,7 +61,7 @@ option_names = ( # {{{ 'bold_font', 'bold_italic_font', 'box_drawing_scale', - 'clear_all_mouse_shortcuts', + 'clear_all_mouse_actions', 'clear_all_shortcuts', 'click_interval', 'clipboard_control', @@ -454,7 +454,7 @@ class Options: bold_font: str = 'auto' bold_italic_font: str = 'auto' box_drawing_scale: typing.Tuple[float, float, float, float] = (0.001, 1.0, 1.5, 2.0) - clear_all_mouse_shortcuts: bool = False + clear_all_mouse_actions: bool = False clear_all_shortcuts: bool = False click_interval: float = -1.0 clipboard_control: typing.Tuple[str, ...] = ('write-clipboard', 'write-primary') diff --git a/kitty/options/utils.py b/kitty/options/utils.py index 3c1a0c52a..d492268b4 100644 --- a/kitty/options/utils.py +++ b/kitty/options/utils.py @@ -696,7 +696,7 @@ def tab_bar_margin_height(x: str) -> TabBarMarginHeight: return TabBarMarginHeight(next(ans), next(ans)) -def clear_all_mouse_shortcuts(val: str, dict_with_parse_results: Optional[Dict[str, Any]] = None) -> bool: +def clear_all_mouse_actions(val: str, dict_with_parse_results: Optional[Dict[str, Any]] = None) -> bool: ans = to_bool(val) if ans and dict_with_parse_results is not None: dict_with_parse_results['mouse_map'] = [None] diff --git a/kitty_tests/options.py b/kitty_tests/options.py index 76da10888..94cd7b95d 100644 --- a/kitty_tests/options.py +++ b/kitty_tests/options.py @@ -41,7 +41,7 @@ class TestConfParsing(BaseTest): self.assertFalse(opts.keymap) opts = p('clear_all_shortcuts y', 'map f1 next_window') self.ae(len(opts.keymap), 1) - opts = p('clear_all_mouse_shortcuts y', 'mouse_map left click ungrabbed mouse_click_url_or_select') + opts = p('clear_all_mouse_actions y', 'mouse_map left click ungrabbed mouse_click_url_or_select') self.ae(len(opts.mousemap), 1) opts = p('strip_trailing_spaces always') self.ae(opts.strip_trailing_spaces, 'always')