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

PATCH: cursor position with push-line from vi command mode



If you bind push-input in vi command mode, the later restored cursor
position doesn't allow for the cursor having moved back for vi command
mode. New command-lines are started in insert mode. This patch adds an
adjustment.

Oliver

diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index bf7b5f4..9f65994 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -821,6 +821,8 @@ pushline(UNUSED(char **args))
     zpushnode(bufstack, zlelineasstring(zleline, zlell, 0, NULL, NULL, 0));
     while (--n)
 	zpushnode(bufstack, ztrdup(""));
+    if (invicmdmode())
+	INCCS();
     stackcs = zlecs;
     *zleline = ZWC('\0');
     zlell = zlecs = 0;



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