Let the user configure word boundaries other than ' ', only works with
the portable character set.
static const char *outfgcolor = "#000000";
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
static unsigned int lines = 0;
+
+/*
+ * Characters not considered part of a word while deleting words
+ * for example: " /?\"&[]"
+ */
+static const char worddelimiters[] = " ";
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 */