summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.def.h6
-rw-r--r--dmenu.c6
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";
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[] = " ";
diff --git a/dmenu.c b/dmenu.c
index a07f8e3..e0c2f80 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -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 */
) 1-3/+0 2009-09-21commenting.Gravatar Enno Boland (tox) 1-0/+1 2009-09-21typoGravatar Enno Boland (tox) 1-2/+2 2009-09-17reformatingGravatar Enno Boland (tox) 1-2/+0 2009-09-17applied patch from arg. thanks :)Gravatar Enno Boland (tox) 2-66/+56 2009-09-16next version is 0.2Gravatar Enno Boland (tox) 1-1/+1 2009-09-16auto creation of script.jsGravatar Enno Boland (tox) 1-0/+3 2009-09-16adding user.js support.Gravatar Enno Boland (tox) 1-4/+22 2009-09-13usercss works again.Gravatar Enno Boland (tox) 1-10/+11 2009-09-11Added tag 0.1.2 for changeset bffb0c3c2341Gravatar Enno Boland (tox) 1-0/+1 2009-09-11next will be 0.1.2Gravatar Enno Boland (tox) 1-1/+1 2009-09-11Makefile fixingGravatar Enno Boland (tox) 2-2/+2 2009-09-11Adding README file.Gravatar Enno Boland (tox) 2-1/+26 2009-09-11unfocus should return false; renaming cookie-file.Gravatar Enno Boland (tox) 1-2/+2 2009-09-11surf embeds now itself into another window.Gravatar Enno Boland (tox) 1-8/+9 2009-09-10Added tag 0.1.1 for changeset 3ef997607115Gravatar Enno Boland (tox) 1-0/+1 2009-09-10bugfix releaseGravatar Enno Boland (tox) 1-1/+1 2009-09-10removing unneeded background color.Gravatar Enno Boland (tox) 1-1/+0 2009-09-10rearranging some source.Gravatar Enno Boland (tox) 1-12/+19 2009-09-10adding user stylesheets.Gravatar Enno Boland (tox) 1-10/+21 2009-09-10Added tag 0.1 for changeset 9c8ebcf54061Gravatar Enno Boland (tox) 1-0/+2 2009-09-10dist doesn't work. fixing Makefile.Gravatar Enno Boland (tox) 1-1/+1