make double click selection smarter and configurable
This commit is contained in:
parent
90c18a9227
commit
d7daf73371
3 changed files with 8 additions and 1 deletions
|
|
@ -400,7 +400,10 @@ def multi_click(self, count, x, y):
|
|||
s.end_x = self.screen.columns - 1
|
||||
elif count == 2:
|
||||
i = x
|
||||
pat = re.compile(r'\w')
|
||||
alphanumeric = 'A-Za-z0-9'
|
||||
optionalchars = re.escape(self.opts.select_by_word_characters)
|
||||
pattern = alphanumeric + optionalchars
|
||||
pat = re.compile(r'['+pattern+']+')
|
||||
while i >= 0 and pat.match(line[i]) is not None:
|
||||
i -= 1
|
||||
s.start_x = i if i == x else i + 1
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ def to_layout_names(raw):
|
|||
'window_border_width': float,
|
||||
'wheel_scroll_multiplier': float,
|
||||
'click_interval': float,
|
||||
'select_by_word_characters': str,
|
||||
'mouse_hide_wait': float,
|
||||
'cursor_blink_interval': float,
|
||||
'cursor_stop_blinking_after': float,
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@ wheel_scroll_multiplier 5.0
|
|||
# The interval between successive clicks to detect double/triple clicks (in seconds)
|
||||
click_interval 0.5
|
||||
|
||||
# Characters considered part of a word when double clicking
|
||||
select_by_word_characters :@-./_~?&=%+#
|
||||
|
||||
# Hide mouse cursor after the specified number of seconds of the mouse not being used. Set to
|
||||
# zero or a negative number to disable mouse cursor hiding.
|
||||
mouse_hide_wait 3.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue