about summary refs log tree commit diff
path: root/Src/Zle/zle_keymap.c
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-12-12 14:12:55 +0100
committerOliver Kiddle <opk@zsh.org>2014-12-12 14:14:00 +0100
commitedb9c94025cebb853142c7e91b88c991ddd21b22 (patch)
tree144c1c98f13c0c476fe8c5755db0f02e0758cc3a /Src/Zle/zle_keymap.c
parentd067ebcacd55472f720b2765ec686a69b25c9a90 (diff)
downloadzsh-edb9c94025cebb853142c7e91b88c991ddd21b22.tar.gz
zsh-edb9c94025cebb853142c7e91b88c991ddd21b22.tar.xz
zsh-edb9c94025cebb853142c7e91b88c991ddd21b22.zip
33950: ignore KEYTIMEOUT for vi operators
Diffstat (limited to 'Src/Zle/zle_keymap.c')
-rw-r--r--Src/Zle/zle_keymap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 48f210c7e..b703ebee1 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -1444,6 +1444,7 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp)
     Thingy func = t_undefinedkey;
     char *str = NULL;
     int lastlen = 0, lastc = lastchar;
+    int timeout = 0;
 
     keybuflen = 0;
     keybuf[0] = 0;
@@ -1461,7 +1462,7 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp)
      * argument to bindkey is in the correct form for the locale.
      * That's beyond our control.
      */
-    while(getkeybuf(!!lastlen) != EOF) {
+    while(getkeybuf(timeout) != EOF) {
 	char *s;
 	Thingy f;
 	int loc = !!localkeymap;
@@ -1480,6 +1481,11 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp)
 	    func = f;
 	    str = s;
 	    lastc = lastchar;
+
+	    /* can be patient with vi commands that need a motion operator: *
+	     * they wait till a key is pressed for the movement anyway      */
+	    timeout = !(!virangeflag && !region_active && f && f->widget &&
+		    f->widget->flags & ZLE_VIOPER);
 	}
 	if (!ispfx)
 	    break;