From e6801867c78a8221aff71ccb347de34a7d6247c8 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 22 Mar 2020 08:10:22 +1100 Subject: [PATCH] Fix bug in terminal output line delete logic --- src/terminal_ui.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc index a14cdf9a..8704fa78 100644 --- a/src/terminal_ui.cc +++ b/src/terminal_ui.cc @@ -215,12 +215,12 @@ void TerminalUI::Screen::output(bool force) }); hashes = std::move(new_hashes); - int added = 0; + int offset = 0; for (auto& change : changes) { if (change.del > change.add) - printf("\033[%dH\033[%dM", change.pos - added + 1, change.del - change.add); - added += change.add; + printf("\033[%dH\033[%dM", change.pos - offset + 1, change.del - change.add); + offset += change.add - change.del; } for (auto& change : changes)