summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_params.c2
-rw-r--r--Src/Zle/zle_utils.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index 5845207fa..dc5fed4ce 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -198,7 +198,7 @@ set_buffer(UNUSED(Param pm), char *x)
 	setline(x, 0);
 	zsfree(x);
     } else
-	zlecs = zlell = 0;
+	viinsbegin = zlecs = zlell = 0;
     fixsuffix();
     menucmp = 0;
 }
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c
index 46d5373fb..741f119d2 100644
--- a/Src/Zle/zle_utils.c
+++ b/Src/Zle/zle_utils.c
@@ -785,6 +785,8 @@ spaceinline(int ct)
 
 	if (mark > zlecs)
 	    mark += ct;
+	if (viinsbegin > zlecs)
+	    viinsbegin = 0;
 
 	if (region_highlights) {
 	    for (rhp = region_highlights + N_SPECIAL_HIGHLIGHTS;
@@ -1104,6 +1106,7 @@ setline(char *s, int flags)
      */
     free(zleline);
 
+    viinsbegin = 0;
     zleline = stringaszleline(scp, 0, &zlell, &linesz, NULL);
 
     if ((flags & ZSL_TOEND) && (zlecs = zlell) && invicmdmode())