diff options
author | Quentin Rameau <quinq@fifth.space> | 2015-12-19 09:32:55 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-12-19 20:32:14 +0100 |
commit | 120e8401074254d39be916ad83bafda9ef25e6a9 (patch) | |
tree | ceab3194f5f8c68ab70ecd4518b7a2b9d2f22fc6 /dmenu.c | |
parent | 32f2564dbbbf5aeafb7190a3d35066142f34448f (diff) |
Add config option for word delimiters
Let the user configure word boundaries other than ' ', only works with
the portable character set.
Diffstat (limited to 'dmenu.c')
-rw-r--r-- | dmenu.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 */ |