Merge pull request #30 from Firenox89/master

make double click selection smarter and configurable
This commit is contained in:
Kovid Goyal 2017-01-13 09:13:36 +05:30 committed by GitHub
commit 6f54a62189
3 changed files with 8 additions and 1 deletions

View File

@ -400,7 +400,10 @@ class CharGrid:
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

View File

@ -105,6 +105,7 @@ type_map = {
'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,

View File

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