diff options
-rw-r--r-- | config.def.h | 6 | ||||
-rw-r--r-- | dmenu.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h index a9122f7..8db1dda 100644 --- a/config.def.h +++ b/config.def.h | |||
@@ -15,3 +15,9 @@ static const char *outbgcolor = "#00ffff"; | |||
15 | static const char *outfgcolor = "#000000"; | 15 | static const char *outfgcolor = "#000000"; |
16 | /* -l option; if nonzero, dmenu uses vertical list with given number of lines */ | 16 | /* -l option; if nonzero, dmenu uses vertical list with given number of lines */ |
17 | static unsigned int lines = 0; | 17 | static unsigned int lines = 0; |
18 | |||
19 | /* | ||
20 | * Characters not considered part of a word while deleting words | ||
21 | * for example: " /?\"&[]" | ||
22 | */ | ||
23 | static const char worddelimiters[] = " "; | ||
@@ -314,9 +314,11 @@ keypress(XKeyEvent *ev) | |||
314 | insert(NULL, 0 - cursor); | 314 | insert(NULL, 0 - cursor); |
315 | break; | 315 | break; |
316 | case XK_w: /* delete word */ | 316 | case XK_w: /* delete word */ |
317 | while (cursor > 0 && text[nextrune(-1)] == ' ') | 317 | while (cursor > 0 && strchr(worddelimiters, |
318 | text[nextrune(-1)])) | ||
318 | insert(NULL, nextrune(-1) - cursor); | 319 | insert(NULL, nextrune(-1) - cursor); |
319 | while (cursor > 0 && text[nextrune(-1)] != ' ') | 320 | while (cursor > 0 && !strchr(worddelimiters, |
321 | text[nextrune(-1)])) | ||
320 | insert(NULL, nextrune(-1) - cursor); | 322 | insert(NULL, nextrune(-1) - cursor); |
321 | break; | 323 | break; |
322 | case XK_y: /* paste selection */ | 324 | case XK_y: /* paste selection */ |