From 91464fa6fb7fbcdeee64a46caa23c2b578f55f3e Mon Sep 17 00:00:00 2001 From: Gunnar Ritter Date: Mon, 10 Jan 2005 23:32:28 +0000 Subject: [PATCH] * Visual 'U' followed by 'u' lead to garbage on the screen when multibyte characters were present on the changed line. --- Changes | 2 ++ ex_version.c | 4 ++-- ex_vops.c | 10 +++++++--- ex_vput.c | 7 +++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index 09a30d5..be2f6e9 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,8 @@ 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. +* 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 characters now. * Handle character case conversions with the '~' vi command correctly if the diff --git a/ex_version.c b/ex_version.c index 5f574cb..b0fd927 100644 --- a/ex_version.c +++ b/ex_version.c @@ -70,12 +70,12 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Sccsid @(#)ex_version.c 1.111 (gritter) 1/10/05 + * Sccsid @(#)ex_version.c 1.112 (gritter) 1/11/05 */ #include "ex.h" -static char *versionstring = "@(#)Version 4.0 (gritter) 1/10/05"; +static char *versionstring = "@(#)Version 4.0 (gritter) 1/11/05"; void printver(void) diff --git a/ex_vops.c b/ex_vops.c index 43ee6d6..4a6816a 100644 --- a/ex_vops.c +++ b/ex_vops.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vops.c 1.24 (gritter) 1/10/05"; +static char sccsid[] = "@(#)ex_vops.c 1.25 (gritter) 1/11/05"; #endif #endif @@ -225,8 +225,12 @@ vundo ( OO = Outchar; Outchar = vinschar; hold |= HOLDQIK; vprepins(); temp[vUA2 - linebuf] = 0; - for (cp = &temp[vUA1 - linebuf]; *cp;) - putchar(*cp++); + for (cp = &temp[vUA1 - linebuf]; *cp;) { + int c, n; + nextc(c, cp, n); + cp += n; + putchar(c); + } Outchar = OO; hold = oldhold; endim(); physdc(cindent(), cindent() + doomed); diff --git a/ex_vput.c b/ex_vput.c index cc1112b..02ae507 100644 --- a/ex_vput.c +++ b/ex_vput.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vput.c 1.38 (gritter) 1/10/05"; +static char sccsid[] = "@(#)ex_vput.c 1.39 (gritter) 1/11/05"; #endif #endif @@ -691,11 +691,10 @@ vinschar(int c) int (*OO)() = Outchar; endim(); if (inscol + insmc0 != linend) - doomed -= inssiz + insmc0; + doomed -= inssiz + insmc1; if (insmc1 == 0 && c != '\t' && vtube0[inscol+insmc0] & MULTICOL) - cellcpy(&vtube0[inscol+insmc0], - &vtube0[inscol+insmc0+1]); + vtube0[inscol+insmc0] = INVBIT; /* * This indicates to vputchar() that it has to set MULTICOL * bits but must not call us recursively.