diff --git a/Changes b/Changes index ee79615..a789471 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,8 @@ 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. +* When a multicolumn character was inserted and then replaced, the visual + screen representation was sometimes not updated accordingly. * 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 796fad3..5f574cb 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.110 (gritter) 1/9/05 + * Sccsid @(#)ex_version.c 1.111 (gritter) 1/10/05 */ #include "ex.h" -static char *versionstring = "@(#)Version 4.0 (gritter) 1/9/05"; +static char *versionstring = "@(#)Version 4.0 (gritter) 1/10/05"; void printver(void) diff --git a/ex_vput.c b/ex_vput.c index 6d46c84..25a4303 100644 --- a/ex_vput.c +++ b/ex_vput.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vput.c 1.34 (gritter) 1/2/05"; +static char sccsid[] = "@(#)ex_vput.c 1.35 (gritter) 1/10/05"; #endif #endif @@ -623,12 +623,6 @@ vinschar(int c) } return c; } - insmc0 = 0; -#ifdef MB - while (inscol+insmc0 < LBSIZE && - (vtube0[inscol+insmc0]&(MULTICOL|TRIM)) == MULTICOL) - insmc0++; -#endif /* MB */ insmc1 = colsc(c) - 1; /* * Compute the number of positions in the line image of the @@ -659,6 +653,16 @@ vinschar(int c) * of the output cursor. */ inscol = destcol + (destline - LINE(vcline)) * WCOLS; + insmc0 = 0; +#ifdef MB + i = 0; + while (inscol+i < LBSIZE && vtube0[inscol+i]&MULTICOL && + (vtube0[inscol+insmc0+i]&(MULTICOL|TRIM)) != MULTICOL) + i++; + while (inscol+insmc0+i < LBSIZE && + (vtube0[inscol+insmc0+i]&(MULTICOL|TRIM)) == MULTICOL) + insmc0++; +#endif /* MB */ if (c == '\t') { /* * Characters inserted from a tab must be