summary refs log tree commit diff
path: root/Src
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 /Src
parent1e41a8a44a7fce08523996d4682b12cb22ec67a4 (diff)
downloadzsh-2b84984769a7dc45368fcb16e00e49890b7bfdc1.tar.gz
zsh-2b84984769a7dc45368fcb16e00e49890b7bfdc1.tar.xz
zsh-2b84984769a7dc45368fcb16e00e49890b7bfdc1.zip
24865: bad character adjustment in vireplacechars()
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_vi.c4
1 files changed, 3 insertions, 1 deletions
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--)