Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Vimode problem (key press dropping)



reply to zsh-users, X-Seq: 20356

On 2015/07/29, at 18:26, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> 
> Question to -workers subscribers: how should we address this in the
> defaults?

In zle_keymap.c, near line 1493, timeout is set only if
(f != t_undefinedkey). But ESC is an undefinedkey in vicmd keymap,
and the timeout remains to be zero even if ispfx is true.

I guess the timeout should always be set if ispfx is true.
Maybe something like the following?


diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index d355f41..f1fa912 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -1495,14 +1495,14 @@ 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;
+
+	/* 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(!lastlen && keybuflen)
 	lastlen = keybuflen;





Messages sorted by: Reverse Date, Date, Thread, Author