summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-11-03 00:31:57 +0100
committerOliver Kiddle <opk@zsh.org>2014-11-03 00:31:57 +0100
commit4d89ec25f17712e8e1710727a7ca211c5591d9e9 (patch)
treefea3328226733c94eb75cc9d0c25f24515182d66
parent023c2236e1280ad1539a2885c6479d0b89d6dc46 (diff)
downloadzsh-4d89ec25f17712e8e1710727a7ca211c5591d9e9.tar.gz
zsh-4d89ec25f17712e8e1710727a7ca211c5591d9e9.zip
33575: reset vi change start position if text is inserted
before it or on history movement
-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())