make double click selection smarter and configurable

This commit is contained in:
firenox89
2017-01-12 23:32:39 +01:00
parent 90c18a9227
commit d7daf73371
3 changed files with 8 additions and 1 deletions
+4 -1
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