From 34bb6487268901df8fdb4d416d318173227b73fd Mon Sep 17 00:00:00 2001 From: Gunnar Ritter Date: Sun, 2 Jan 2005 01:39:45 +0000 Subject: [PATCH] * When a multicolumn character was replaced by another multicolumn character in insert mode, the display was not updated appropriately with terminals other than xterm. --- Changes | 3 +++ ex_version.c | 2 +- ex_vput.c | 24 +++++++++++++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 0fedbda..069764b 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,7 @@ Release ... +* When a multicolumn character was replaced by another multicolumn character + in insert mode, the display was not updated appropriately with terminals + other than xterm. * Handle character case conversions with the '~' vi command correctly if the length of the converted multibyte sequence is smaller than the original one. diff --git a/ex_version.c b/ex_version.c index 73a1a81..c19993a 100644 --- a/ex_version.c +++ b/ex_version.c @@ -70,7 +70,7 @@ * 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.108 (gritter) 1/2/05 + * Sccsid @(#)ex_version.c 1.109 (gritter) 1/2/05 */ #include "ex.h" diff --git a/ex_vput.c b/ex_vput.c index f4535c4..6d46c84 100644 --- a/ex_vput.c +++ b/ex_vput.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vput.c 1.33 (gritter) 12/2/04"; +static char sccsid[] = "@(#)ex_vput.c 1.34 (gritter) 1/2/05"; #endif #endif @@ -677,6 +677,7 @@ vinschar(int c) * rather we can just typeover. */ if (inssiz + insmc1 <= doomed) { + int (*OO)() = Outchar; endim(); if (inscol + insmc0 != linend) doomed -= inssiz + insmc1; @@ -684,9 +685,15 @@ vinschar(int c) vtube0[inscol+insmc0] & MULTICOL) cellcpy(&vtube0[inscol+insmc0+1], &vtube0[inscol+insmc0+2]); + /* + * This indicates to vputchar() that it has to set MULTICOL + * bits but must not call us recursively. + */ + Outchar = NULL; do vputchar(c); while (--inssiz); + Outchar = OO; return c; } @@ -1412,8 +1419,19 @@ def: Outchar != vinschar && (d = colsc(c&TRIM)) > 1) { if ((*tp&MULTICOL) == 0) { *tp |= MULTICOL; - while (--d) - (*Outchar)(MULTICOL); + if (Outchar) { + while (--d) + (*Outchar)(MULTICOL); + } else { + /* + * This occurs when replacing characters. + */ + while (--d) { + *++tp = MULTICOL; + destcol++; + outcol++; + } + } } } #endif /* MB */