Handle skipped characters with erase line (EL) instead of insert blank (ICH)
insert blank seems to behave differently between terminals and would be less efficient because it still has to shift all following characters (that we will overwrite anyway). Fixes #3437
This commit is contained in:
parent
b0dcb07540
commit
72271ce529
|
@ -271,25 +271,25 @@ void TerminalUI::Screen::output(bool force)
|
|||
printf("\033[%dH", line + 1);
|
||||
|
||||
ColumnCount pending_move = 0;
|
||||
for (auto& atom : lines[line++].atoms)
|
||||
for (auto& [text, skip, face] : lines[line++].atoms)
|
||||
{
|
||||
if (text.empty() and skip == 0)
|
||||
continue;
|
||||
|
||||
if (pending_move != 0)
|
||||
{
|
||||
printf("\033[%dC", (int)pending_move);
|
||||
pending_move = 0;
|
||||
}
|
||||
set_face(atom.face);
|
||||
fputs(atom.text.c_str(), stdout);
|
||||
if (atom.skip > 0)
|
||||
set_face(face);
|
||||
fputs(text.c_str(), stdout);
|
||||
if (skip > 3 and face.attributes == Attribute{})
|
||||
{
|
||||
if (atom.skip > 4 and atom.face.attributes == Attribute{})
|
||||
{
|
||||
printf("\033[%d@", (int)atom.skip);
|
||||
pending_move = atom.skip;
|
||||
}
|
||||
else for (ColumnCount c = 0; c < atom.skip; ++c)
|
||||
fputs(" ", stdout);
|
||||
fputs("\033[K", stdout);
|
||||
pending_move = skip;
|
||||
}
|
||||
else if (skip > 0)
|
||||
fputs(String{' ', skip}.c_str(), stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user