diff options
author | Anselm R. Garbe <arg@suckless.org> | 2007-02-26 14:07:19 +0100 |
---|---|---|
committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-26 14:07:19 +0100 |
commit | 03c2b05bb2265e0ef7ba33b7f6df36bd6e0ce54d (patch) | |
tree | 8cc380e6e00ffd98e5e1827f5b1ee98643d4614d | |
parent | 8a066fabd9796ca80f5a359c3c6cf57c947b1b95 (diff) |
changed Backspace/C-w behavior (now it only removes a single character)
-rw-r--r-- | dmenu.1 | 2 | ||||
-rw-r--r-- | main.c | 8 |
2 files changed, 3 insertions, 7 deletions
@@ -82,7 +82,7 @@ Quit without selecting an item. Returns | |||
82 | on termination. | 82 | on termination. |
83 | .TP | 83 | .TP |
84 | .B Backspace (Control\-h) | 84 | .B Backspace (Control\-h) |
85 | Remove enough characters from the input field to change its filtering effect. | 85 | Remove a character from the input field. |
86 | .TP | 86 | .TP |
87 | .B Control\-u | 87 | .B Control\-u |
88 | Remove all characters from the input field. | 88 | Remove all characters from the input field. |
@@ -289,12 +289,8 @@ kpress(XKeyEvent * e) { | |||
289 | } | 289 | } |
290 | break; | 290 | break; |
291 | case XK_BackSpace: | 291 | case XK_BackSpace: |
292 | if((i = len)) { | 292 | if(len) { |
293 | prev_nitem = nitem; | 293 | text[--len] = 0; |
294 | do { | ||
295 | text[--i] = 0; | ||
296 | match(text); | ||
297 | } while(i && nitem && prev_nitem == nitem); | ||
298 | match(text); | 294 | match(text); |
299 | } | 295 | } |
300 | break; | 296 | break; |