* Made multicolumn characters work in lines longer than the screen width in

visual mode (Bugreport by Matthew Fischer).
This commit is contained in:
Gunnar Ritter
2005-02-15 16:31:11 +00:00
parent 625b7e45f5
commit d1a3bb3efa
9 changed files with 82 additions and 32 deletions

View File

@@ -73,7 +73,7 @@
#ifndef lint
#ifdef DOSCCS
static char sccsid[] = "@(#)ex_subr.c 1.34 (gritter) 1/13/05";
static char sccsid[] = "@(#)ex_subr.c 1.36 (gritter) 2/15/05";
#endif
#endif
@@ -659,12 +659,20 @@ qcolumn(register char *lim, register char *gp)
int
qcount(int c)
{
int sc;
if (c == '\t') {
vcntcol += value(TABSTOP) - vcntcol % value(TABSTOP);
return c;
}
vcntcol += c & MULTICOL ? 1 : colsc(c);
/*
* Take account of filler characters inserted at the end of
* the visual line if a multi-column character does not fit.
*/
sc = colsc(c);
while (vcntcol < WCOLS && vcntcol + sc - 1 >= WCOLS)
vcntcol++;
vcntcol += c & MULTICOL ? 1 : sc;
return c;
}
@@ -1025,6 +1033,8 @@ exitex(int i)
if (trace)
fclose(trace);
# endif
if (failed != 0 && i == 0)
i = failed;
_exit(i);
/*NOTREACHED*/
return 0;