---
 dmenu.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/dmenu.c b/dmenu.c
index a246111..90feea5 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -345,6 +345,20 @@ keypress(XKeyEvent *ev)
                }
        else if (ev->state & Mod1Mask)
                switch(ksym) {
+               case XK_b: /* move cursor to left delimiter */
+                       while (cursor > 0 && strchr(worddelimiters, 
text[nextrune(-1)]))
+                               cursor = nextrune(-1);
+                       while (cursor > 0 && !strchr(worddelimiters, 
text[nextrune(-1)]))
+                               cursor = nextrune(-1);
+                       ksym = NoSymbol;
+                       break;
+               case XK_f: /* move cursor to right delimiter */
+                       while (text[cursor] && !strchr(worddelimiters, 
text[cursor]))
+                               cursor = nextrune(+1);
+                       while (text[cursor] && strchr(worddelimiters, 
text[cursor]))
+                               cursor = nextrune(+1);
+                       ksym = NoSymbol;
+                       break;
                case XK_g: ksym = XK_Home;  break;
                case XK_G: ksym = XK_End;   break;
                case XK_h: ksym = XK_Up;    break;
@@ -359,6 +373,8 @@ keypress(XKeyEvent *ev)
                if (!iscntrl(*buf))
                        insert(buf, len);
                break;
+       case NoSymbol:
+               break;
        case XK_Delete:
                if (text[cursor] == '\0')
                        return;
-- 
2.16.2


Reply via email to