summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-04-23 08:43:38 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-04-23 08:43:38 +0000
commit2b84984769a7dc45368fcb16e00e49890b7bfdc1 (patch)
treeb90fb19c58a8e477251b0585ceb55f8c6b5600c6
parent1e41a8a44a7fce08523996d4682b12cb22ec67a4 (diff)
downloadzsh-2b84984769a7dc45368fcb16e00e49890b7bfdc1.tar.gz
zsh-2b84984769a7dc45368fcb16e00e49890b7bfdc1.tar.xz
zsh-2b84984769a7dc45368fcb16e00e49890b7bfdc1.zip
24865: bad character adjustment in vireplacechars()
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/zle_vi.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index cea4a566e..51d3e0614 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-04-23  Peter Stephenson  <pws@csr.com>
 
+	* 24865: Src/zle_vi.c: bad character adjustment in
+	vireplacechars().
+
 	* 24864: Jun T.: configure.ac, Src/zsh.h: typos in 24861.
 
 2008-04-22  Peter Stephenson  <pws@csr.com>
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index 16b741b75..d966a29ce 100644
--- a/Src/Zle/zle_vi.c
+++ b/Src/Zle/zle_vi.c
@@ -540,9 +540,11 @@ vireplacechars(UNUSED(char **args))
 	 * Make sure we delete displayed characters, including
 	 * attach combining characters. n includes this as a raw
 	 * buffer offset.
+	 * Use shiftchars so as not to adjust the cursor position;
+	 * we are overwriting anything that remains directly.
 	 */
 	if (n > newchars)
-	    foredel(n - newchars, CUT_RAW);
+	    shiftchars(zlecs, n - newchars);
 	else if (n < newchars)
 	    spaceinline(newchars - n);
 	while (newchars--)