Add word-and-line-from-point feature to possible mouse selection actions.

This commit is contained in:
Eric Myhre
2023-09-26 04:37:13 +02:00
parent 6a3529b7c2
commit d310acc780
6 changed files with 28 additions and 2 deletions

View File

@@ -722,6 +722,11 @@ mma('Select line from point',
long_text='Select from the clicked point to the end of the line.'
)
mma('Select a word at the point, together with the rest of the line',
'select_word_and_line_from_point ctrl+alt+left triplepress ungrabbed mouse_selection word_and_line_from_point',
long_text='Select the word under the clicked point, as well as through the end of the line.'
)
mma('Extend the current selection',
'extend_selection right press ungrabbed mouse_selection extend',
long_text='''
@@ -759,6 +764,11 @@ mma('Select line from point even when grabbed',
long_text='Select from the clicked point to the end of the line even when grabbed.'
)
mma('Select line from point even when grabbed',
'select_word_and_line_from_point_grabbed ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection word_and_line_from_point',
long_text='Select the click word and to end of line, even when grabbed.'
)
mma('Extend the current selection even when grabbed',
'extend_selection_grabbed shift+right press ungrabbed,grabbed mouse_selection extend',
)

View File

@@ -388,6 +388,7 @@ def mouse_selection(func: str, rest: str) -> FuncArgsType:
'word': defines.MOUSE_SELECTION_WORD,
'line': defines.MOUSE_SELECTION_LINE,
'line_from_point': defines.MOUSE_SELECTION_LINE_FROM_POINT,
'word_and_line_from_point': defines.MOUSE_SELECTION_WORD_AND_LINE_FROM_POINT,
}
setattr(mouse_selection, 'code_map', cmap)
return func, [cmap[rest]]