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

PATCH: cursor shape for viopp mode



Given keybindings which have other vi bindings as a prefix, we don't
apply KEYTIMEOUT because we've got to wait for a movement command
anyway. This delays running the vi widget so the cursor change was not
happening. The following adds a cursor change also for such situations.

Oliver

diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 95a60bcc2..ea80f9e3c 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -1623,8 +1623,13 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp)
 
 	    /* 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 (!(timeout = !(!virangeflag && !region_active && f && f->widget &&
+		    f->widget->flags & ZLE_VIOPER))) {
+		int nochg = vichgflag;
+		vichgflag = 2;
+		cursor_form();
+		vichgflag = nochg;
+	    }
 #ifdef MULTIBYTE_SUPPORT
 	    if ((f == Th(z_selfinsert) || f == Th(z_selfinsertunmeta)) &&
 		!lastchar_wide_valid && !ispfx) {




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