clear_all_mouse_shortcuts -> clear_all_mouse_actions

This commit is contained in:
Kovid Goyal 2021-08-07 21:34:16 +05:30
parent 0e2f1b9405
commit e1ed9aca10
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
7 changed files with 16 additions and 13 deletions

View File

@ -32,6 +32,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- 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]
----------------------

View File

@ -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))

View File

@ -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.
'''
)

View File

@ -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)

View File

@ -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')

View File

@ -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]

View File

@ -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')