* Various rendering errors happened with multicolumn characters if they

started at an even column (counting from 1 upwards).
This commit is contained in:
Gunnar Ritter 2005-01-13 18:51:47 +00:00
parent b75f03c3ca
commit a40b8f3ae0
4 changed files with 27 additions and 43 deletions

View File

@ -2,6 +2,8 @@ Release ...
* When a multicolumn character was replaced by another multicolumn character * When a multicolumn character was replaced by another multicolumn character
in insert mode, the display was not updated appropriately with terminals in insert mode, the display was not updated appropriately with terminals
other than xterm. other than xterm.
* Various rendering errors happened with multicolumn characters if they
started at an even column (counting from 1 upwards).
* When a multicolumn character was inserted and then replaced, the visual * When a multicolumn character was inserted and then replaced, the visual
screen representation was sometimes not updated accordingly. screen representation was sometimes not updated accordingly.
* Undoing the replacement of a multicolumn character by a singlecolumn * Undoing the replacement of a multicolumn character by a singlecolumn

View File

@ -73,7 +73,7 @@
#ifndef lint #ifndef lint
#ifdef DOSCCS #ifdef DOSCCS
static char sccsid[] = "@(#)ex_put.c 1.26 (gritter) 12/2/04"; static char sccsid[] = "@(#)ex_put.c 1.27 (gritter) 1/13/05";
#endif #endif
#endif #endif
@ -751,13 +751,17 @@ dontcr:
i = ' '; i = ' ';
if(i & QUOTE) /* mjm: no sign extension on 3B */ if(i & QUOTE) /* mjm: no sign extension on 3B */
i = ' '; i = ' ';
if (i != MULTICOL) { if ((insmode || i == MULTICOL) && ND)
if (insmode && ND)
tputs(ND, 0, plodput); tputs(ND, 0, plodput);
else if (i == MULTICOL) {
if (BS && BC)
tputs(BC, 0, plodput);
else else
plodput('\b');
plodput(vtube[outline][outcol-1]);
} else
plodput(i); plodput(i);
} outcol += i == MULTICOL ? 1 : colsc(i);
outcol++;
} }
if (plodcnt < 0) if (plodcnt < 0)
goto out; goto out;

View File

@ -70,12 +70,12 @@
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* Sccsid @(#)ex_version.c 1.114 (gritter) 1/12/05 * Sccsid @(#)ex_version.c 1.115 (gritter) 1/13/05
*/ */
#include "ex.h" #include "ex.h"
static char *versionstring = "@(#)Version 4.0 (gritter) 1/12/05"; static char *versionstring = "@(#)Version 4.0 (gritter) 1/13/05";
void void
printver(void) printver(void)

View File

@ -73,7 +73,7 @@
#ifndef lint #ifndef lint
#ifdef DOSCCS #ifdef DOSCCS
static char sccsid[] = "@(#)ex_vput.c 1.40 (gritter) 1/11/05"; static char sccsid[] = "@(#)ex_vput.c 1.41 (gritter) 1/13/05";
#endif #endif
#endif #endif
@ -373,7 +373,7 @@ vgoto(register int y, register int x)
x %= WCOLS; x %= WCOLS;
} }
#ifdef MB #ifdef MB
else if (y >= 0 && mb_cur_max > 1 && !insmode) { if (y >= 0 && mb_cur_max > 1 && !insmode) {
while (x > 0 && (vtube[y][x]&(MULTICOL|TRIM)) == MULTICOL) while (x > 0 && (vtube[y][x]&(MULTICOL|TRIM)) == MULTICOL)
x--; x--;
} }
@ -589,7 +589,6 @@ vinschar(int c)
insmc1 = colsc(c) - 1; insmc1 = colsc(c) - 1;
if ((!IM || !EI) && ((hold & HOLDQIK) || !value(REDRAW) || value(SLOWOPEN))) { if ((!IM || !EI) && ((hold & HOLDQIK) || !value(REDRAW) || value(SLOWOPEN))) {
int (*OO)() = Outchar;
/* /*
* Don't want to try to use terminal * Don't want to try to use terminal
* insert mode, or to try to fake it. * insert mode, or to try to fake it.
@ -600,13 +599,7 @@ vinschar(int c)
vgotab(); vgotab();
return c; return c;
} }
/*
* This indicates to vputchar() that it has to set MULTICOL
* bits but must not call us recursively.
*/
Outchar = NULL;
vputchar(c); vputchar(c);
Outchar = OO;
if (insmc1 == 0 && (vtube0[destcol]&(TRIM|MULTICOL))==MULTICOL) if (insmc1 == 0 && (vtube0[destcol]&(TRIM|MULTICOL))==MULTICOL)
vtube0[destcol] = INVBIT; vtube0[destcol] = INVBIT;
if (DEPTH(vcline) * WCOLS + !value(REDRAW) > if (DEPTH(vcline) * WCOLS + !value(REDRAW) >
@ -690,22 +683,15 @@ vinschar(int c)
* rather we can just typeover. * rather we can just typeover.
*/ */
if (inssiz + insmc1 <= doomed) { if (inssiz + insmc1 <= doomed) {
int (*OO)() = Outchar;
endim(); endim();
if (inscol + insmc0 != linend) if (inscol + insmc0 != linend)
doomed -= inssiz + insmc1; doomed -= inssiz + insmc1;
if (insmc1 == 0 && c != '\t' && if (insmc1 == 0 && c != '\t' &&
vtube0[inscol+insmc0] & MULTICOL) vtube0[inscol+insmc0] & MULTICOL)
vtube0[inscol+insmc0] = INVBIT; vtube0[inscol+insmc0] = INVBIT;
/*
* This indicates to vputchar() that it has to set MULTICOL
* bits but must not call us recursively.
*/
Outchar = NULL;
do do
vputchar(c); vputchar(c);
while (--inssiz); while (--inssiz);
Outchar = OO;
return c; return c;
} }
@ -1062,10 +1048,10 @@ viin(int c)
vigotoCL(inscol); vigotoCL(inscol);
remdoom = doomed; remdoom = doomed;
for (i = inssiz; i > 0; i--) { for (i = inssiz; i > 0; i--) {
if (remdoom > 0) { if (remdoom > insmc1) {
remdoom--; remdoom--;
endim(); endim();
} else if (noim) } else if (noim || remdoom == insmc1)
endim(); endim();
else if (IM && EI) { else if (IM && EI) {
vcsync(); vcsync();
@ -1074,7 +1060,7 @@ viin(int c)
vputchar(c); vputchar(c);
} }
if (!IM || !EI) { if (!IM || !EI || remdoom == insmc1) {
/* /*
* We are a dumb terminal; brute force update * We are a dumb terminal; brute force update
* the rest of the line; this is very much an n^^2 process, * the rest of the line; this is very much an n^^2 process,
@ -1428,26 +1414,18 @@ def:
} }
} }
#ifdef MB #ifdef MB
if (mb_cur_max > 1 && (hold & HOLDPUPD) == 0 && if (mb_cur_max > 1 && (d = colsc(c&TRIM)) > 1) {
Outchar != vinschar && (d = colsc(c&TRIM)) > 1) {
if ((*tp&MULTICOL) == 0) { if ((*tp&MULTICOL) == 0) {
if ((hold & HOLDPUPD) == 0)
*tp |= MULTICOL; *tp |= MULTICOL;
if (Outchar) {
while (--d)
(*Outchar)(MULTICOL);
} else {
/*
* This occurs when replacing characters,
* or in open mode.
*/
while (--d) { while (--d) {
if ((hold & HOLDPUPD) == 0)
*++tp = MULTICOL; *++tp = MULTICOL;
destcol++; destcol++;
outcol++; outcol++;
} }
} }
} }
}
#endif /* MB */ #endif /* MB */
return c; return c;
} }