From 4d481fff00e787caae1ab6b7628e069c41735588 Mon Sep 17 00:00:00 2001 From: Gunnar Ritter Date: Tue, 11 Jan 2005 14:07:04 +0000 Subject: [PATCH] * The 'cw' visual command with a multibyte character as last character of the affected word located at the end of the line left garbage bytes past the end of the new text. --- Changes | 3 +++ ex_voper.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index be2f6e9..0f8a558 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,9 @@ Release ... screen representation was sometimes not updated accordingly. * Undoing the replacement of a multicolumn character by a singlecolumn character twice made the singlecolumn character invisible. +* The 'cw' visual command with a multibyte character as last character of + the affected word located at the end of the line left garbage bytes past + the end of the new text. * Visual 'U' followed by 'u' lead to garbage on the screen when multibyte characters were present on the changed line. * The '\u', '\l', '\U', and '\L' substitution sequences work with multibyte diff --git a/ex_voper.c b/ex_voper.c index d4772d7..910a05f 100644 --- a/ex_voper.c +++ b/ex_voper.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_voper.c 1.23 (gritter) 12/1/04"; +static char sccsid[] = "@(#)ex_voper.c 1.24 (gritter) 1/11/05"; #endif #endif @@ -830,7 +830,7 @@ find(int c) int word(register void (*op)(int), int cnt) { - register int which = 0; + register int which = 0, i; register char *iwc; register line *iwdot = wdot; @@ -839,9 +839,9 @@ word(register void (*op)(int), int cnt) which = wordch(wcursor); while (wordof(which, wcursor)) { if (cnt == 1 && op != vmove && - wcursor[skipright(linebuf, wcursor)] + wcursor[i = skipright(linebuf, wcursor)] == 0) { - wcursor++; + wcursor += i; break; } if (!lnext())