summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/zle_params.c2
-rw-r--r--Src/Zle/zle_utils.c3
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 678b561ac..2616ac480 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-02  Oliver Kiddle  <opk@zsh.org>
+
+	* 33575: Src/Zle/zle_params.c, Src/Zle/zle_utils.c: reset vi change
+	start position if text is inserted before it or on history movement
+
 2014-11-02  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 33591: Src/exec.c, Test/D04parameter.ztst: don't treat an exec
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())