X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu.c;h=e0c2f80444f9fb8b3ad4f864d16e8b358117b29e;hb=120e8401074254d39be916ad83bafda9ef25e6a9;hp=a07f8e32145faae2a9ca75dfab9c6681617ea148;hpb=32f2564dbbbf5aeafb7190a3d35066142f34448f;p=dmenu.git 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 */