Fix bug in terminal output line delete logic

This commit is contained in:
Maxime Coste 2020-03-22 08:10:22 +11:00
parent 5a31b9f351
commit e6801867c7

View File

@ -215,12 +215,12 @@ void TerminalUI::Screen::output(bool force)
}); });
hashes = std::move(new_hashes); hashes = std::move(new_hashes);
int added = 0; int offset = 0;
for (auto& change : changes) for (auto& change : changes)
{ {
if (change.del > change.add) if (change.del > change.add)
printf("\033[%dH\033[%dM", change.pos - added + 1, change.del - change.add); printf("\033[%dH\033[%dM", change.pos - offset + 1, change.del - change.add);
added += change.add; offset += change.add - change.del;
} }
for (auto& change : changes) for (auto& change : changes)