Add config option for word delimiters

Let the user configure word boundaries other than ' ', only works with
the portable character set.
This commit is contained in:
Quentin Rameau authored and Hiltjo Posthuma committed 2015-12-19 20:32:14 +01:00
1 parent 32f2564dbb
commit 120e840107
2 files changed
+10 -2

No files matched your search

+4 -2
View File
@@ -314,9 +314,11 @@ keypress(XKeyEvent *ev)
insert(NULL, 0 - cursor);
break;
case XK_w: /* delete word */
while (cursor > 0 && text[nextrune(-1)] == ' ')
while (cursor > 0 && strchr(worddelimiters,
text[nextrune(-1)]))
insert(NULL, nextrune(-1) - cursor);
while (cursor > 0 && text[nextrune(-1)] != ' ')
while (cursor > 0 && !strchr(worddelimiters,
text[nextrune(-1)]))
insert(NULL, nextrune(-1) - cursor);
break;
case XK_y: /* paste selection */