mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 02:31:45 +02:00
clear_all_mouse_shortcuts -> clear_all_mouse_actions
This commit is contained in:
@@ -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
|
- terminfo: Fix "cnorm" the property for setting the cursor to normal using a
|
||||||
solid block rather than a blinking block cursor (:iss:`3906`)
|
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]
|
0.22.2 [2021-08-02]
|
||||||
----------------------
|
----------------------
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ def finalize_keys(opts: Options) -> None:
|
|||||||
def finalize_mouse_mappings(opts: Options) -> None:
|
def finalize_mouse_mappings(opts: Options) -> None:
|
||||||
defns: List[MouseMapping] = []
|
defns: List[MouseMapping] = []
|
||||||
for d in opts.mouse_map:
|
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
|
defns = [] # type: ignore
|
||||||
else:
|
else:
|
||||||
defns.append(d.resolve_and_copy(opts.kitty_mod, opts.kitten_alias))
|
defns.append(d.resolve_and_copy(opts.kitty_mod, opts.kitten_alias))
|
||||||
|
|||||||
@@ -499,11 +499,11 @@ of URLs with a plain click::
|
|||||||
automatically end it and no release event will be dispatched.
|
automatically end it and no release event will be dispatched.
|
||||||
''')
|
''')
|
||||||
|
|
||||||
opt('clear_all_mouse_shortcuts', 'no',
|
opt('clear_all_mouse_actions', 'no',
|
||||||
option_type='clear_all_mouse_shortcuts',
|
option_type='clear_all_mouse_actions',
|
||||||
long_text='''
|
long_text='''
|
||||||
You can have kitty remove all mouse shortcut definition seen up to this point.
|
You can have kitty remove all mouse actions seen up to this point.
|
||||||
Useful, for instance, to remove the default mouse shortcuts.
|
Useful, for instance, to remove the default mouse actions.
|
||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
8
kitty/options/parse.py
generated
8
kitty/options/parse.py
generated
@@ -8,7 +8,7 @@ from kitty.conf.utils import (
|
|||||||
)
|
)
|
||||||
from kitty.options.utils import (
|
from kitty.options.utils import (
|
||||||
active_tab_title_template, adjust_baseline, adjust_line_height, allow_hyperlinks,
|
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,
|
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_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,
|
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:
|
def box_drawing_scale(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
|
||||||
ans['box_drawing_scale'] = box_drawing_scale(val)
|
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:
|
def clear_all_shortcuts(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
|
||||||
clear_all_shortcuts(val, ans)
|
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:
|
def click_interval(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
|
||||||
ans['click_interval'] = float(val)
|
ans['click_interval'] = float(val)
|
||||||
|
|
||||||
|
|||||||
4
kitty/options/types.py
generated
4
kitty/options/types.py
generated
@@ -61,7 +61,7 @@ option_names = ( # {{{
|
|||||||
'bold_font',
|
'bold_font',
|
||||||
'bold_italic_font',
|
'bold_italic_font',
|
||||||
'box_drawing_scale',
|
'box_drawing_scale',
|
||||||
'clear_all_mouse_shortcuts',
|
'clear_all_mouse_actions',
|
||||||
'clear_all_shortcuts',
|
'clear_all_shortcuts',
|
||||||
'click_interval',
|
'click_interval',
|
||||||
'clipboard_control',
|
'clipboard_control',
|
||||||
@@ -454,7 +454,7 @@ class Options:
|
|||||||
bold_font: str = 'auto'
|
bold_font: str = 'auto'
|
||||||
bold_italic_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)
|
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
|
clear_all_shortcuts: bool = False
|
||||||
click_interval: float = -1.0
|
click_interval: float = -1.0
|
||||||
clipboard_control: typing.Tuple[str, ...] = ('write-clipboard', 'write-primary')
|
clipboard_control: typing.Tuple[str, ...] = ('write-clipboard', 'write-primary')
|
||||||
|
|||||||
@@ -696,7 +696,7 @@ def tab_bar_margin_height(x: str) -> TabBarMarginHeight:
|
|||||||
return TabBarMarginHeight(next(ans), next(ans))
|
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)
|
ans = to_bool(val)
|
||||||
if ans and dict_with_parse_results is not None:
|
if ans and dict_with_parse_results is not None:
|
||||||
dict_with_parse_results['mouse_map'] = [None]
|
dict_with_parse_results['mouse_map'] = [None]
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class TestConfParsing(BaseTest):
|
|||||||
self.assertFalse(opts.keymap)
|
self.assertFalse(opts.keymap)
|
||||||
opts = p('clear_all_shortcuts y', 'map f1 next_window')
|
opts = p('clear_all_shortcuts y', 'map f1 next_window')
|
||||||
self.ae(len(opts.keymap), 1)
|
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)
|
self.ae(len(opts.mousemap), 1)
|
||||||
opts = p('strip_trailing_spaces always')
|
opts = p('strip_trailing_spaces always')
|
||||||
self.ae(opts.strip_trailing_spaces, 'always')
|
self.ae(opts.strip_trailing_spaces, 'always')
|
||||||
|
|||||||
Reference in New Issue
Block a user