mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-20 00:06:45 -05:00
Make 'show_line()' do proper TAB handling
The TAB handling got broken by commit cee00b0efb
("Show UTF-8 input as
UTF-8 output") when it stopped doing things one byte at a time.
I'm sure the other special character cases are broken too.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
42d9cb33a5
commit
4bccfab632
21
display.c
21
display.c
@ -442,13 +442,26 @@ static void show_line(struct line *lp)
|
|||||||
|
|
||||||
while (i < len) {
|
while (i < len) {
|
||||||
unicode_t c;
|
unicode_t c;
|
||||||
|
int n;
|
||||||
|
|
||||||
i += utf8_to_unicode(lp->l_text, i, len, &c);
|
if (vtcol >= term.t_ncol) {
|
||||||
if (vtcol >= term.t_ncol)
|
|
||||||
vp->v_text[term.t_ncol - 1] = '$';
|
vp->v_text[term.t_ncol - 1] = '$';
|
||||||
else if (vtcol >= 0)
|
return;
|
||||||
vp->v_text[vtcol] = c;
|
}
|
||||||
|
n = utf8_to_unicode(lp->l_text, i, len, &c);
|
||||||
|
/*
|
||||||
|
* Change tabs into spaces, and don't increment
|
||||||
|
* the text source until we hit tabmask
|
||||||
|
*/
|
||||||
++vtcol;
|
++vtcol;
|
||||||
|
if (c == '\t') {
|
||||||
|
c = ' ';
|
||||||
|
if (vtcol & tabmask)
|
||||||
|
n = 0;
|
||||||
|
}
|
||||||
|
if (vtcol > 0)
|
||||||
|
vp->v_text[vtcol-1] = c;
|
||||||
|
i += n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user