From 00302b74d16a082e7a096291e241cb361bc5a6c5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 23 May 2021 11:37:26 +0530 Subject: [PATCH] Add a default mapping for line_from_point selection --- docs/changelog.rst | 4 ++-- docs/index.rst | 2 ++ kitty/config_data.py | 12 +++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 4c5771fdd..e2c32324e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,8 +22,8 @@ To update |kitty|, :doc:`follow the instructions `. ignored. The options were: ``terminal_select_modifiers``, ``rectangle_select_modifiers`` and ``open_url_modifiers``. -- Add a configurable mouse action to select from the clicked point to the end of the line. - (:iss:`3585`) +- Add a configurable mouse action (:kbd:`ctrl+alt+triplepress` to select from the + clicked point to the end of the line. (:iss:`3585`) - Add the ability to un-scroll the screen to the ``kitty @ scroll-window`` remote control command (:iss:`3604`) diff --git a/docs/index.rst b/docs/index.rst index f5a414faa..d4b174a93 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -257,6 +257,8 @@ Mouse features * You can click on a URL to open it in a browser. * You can double click to select a word and then drag to select more words. * You can triple click to select a line and then drag to select more lines. +* You can triple click while holding :kbd:`ctrl+alt` to select from clicked + point to end of line. * You can right click to extend a previous selection. * You can hold down :kbd:`ctrl+alt` and drag with the mouse to select in columns. diff --git a/kitty/config_data.py b/kitty/config_data.py index 71c1f0318..032eb2817 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -6,12 +6,12 @@ import os from gettext import gettext as _ from typing import ( - Any, Callable, Dict, FrozenSet, Iterable, List, Optional, Set, + Callable, Dict, FrozenSet, Iterable, List, Optional, Set, Tuple, TypeVar, Union ) from . import fast_data_types as defines -from .conf.definition import Option, OptionOrAction, option_func +from .conf.definition import OptionOrAction, option_func from .conf.utils import ( choices, to_bool, to_cmdline as tc, to_color, to_color_or_none, unit_float ) @@ -683,11 +683,9 @@ for grabbed in (False, True): m('start_rectangle_selection' + name_s, mods_p + 'ctrl+alt+left', 'press', modes, 'mouse_selection rectangle', _('Start selecting text in a rectangle') + ts) m('select_word' + name_s, mods_p + 'left', 'doublepress', modes, 'mouse_selection word', _('Select a word') + ts) - line_desc = '' - if not grabbed: - line_desc = _('Select the entire line. If you would rather select from the clicked' - ' point to the end of the line, use ``line_at_point`` instead of ``line`` above') - m('select_line' + name_s, mods_p + 'left', 'triplepress', modes, 'mouse_selection line', _('Select a line') + ts, line_desc) + m('select_line' + name_s, mods_p + 'left', 'triplepress', modes, 'mouse_selection line', _('Select a line') + ts, _('Select the entire line')) + m('select_line_from_point' + name_s, mods_p + 'ctrl+alt+left', 'triplepress', modes, + 'mouse_selection line_from_point', _('Select line from point') + ts, _('Select from the clicked point to the end of the line')) m('extend_selection' + name_s, mods_p + 'right', 'press', modes, 'mouse_selection extend', _('Extend the current selection') + ts) # }}}