summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-03-22 08:10:22 +1100
committerMaxime Coste <mawww@kakoune.org>2021-07-12 10:25:58 +1000
commite6801867c78a8221aff71ccb347de34a7d6247c8 (patch)
tree982efeaf23ba28e27eec6e5750ece232b6e087ce /src
parent5a31b9f35168513302fcc437fc0be21c42ae78d8 (diff)
Fix bug in terminal output line delete logic
Diffstat (limited to 'src')
-rw-r--r--src/terminal_ui.cc6
1 files 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)