summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibLine
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-03-05 15:31:13 +0330
committerAndreas Kling <kling@serenityos.org>2021-03-07 10:59:51 +0100
commitcad7865ad194b57ed7a355358d0ab83dae2d3bd3 (patch)
tree6b3330bb40fe786cfac8ea285fdfe9ccad388386 /Userland/Libraries/LibLine
parentc580348ebd1e36056d4340df4ccae37a5256ca56 (diff)
downloadserenity-cad7865ad194b57ed7a355358d0ab83dae2d3bd3.zip
LibLine: Clear the buffer after invalidating prior written data
Otherwise this would set m_chars_touched_in_the_middle to zero, which is exactly the wrong thing to do.
Diffstat (limited to 'Userland/Libraries/LibLine')
-rw-r--r--Userland/Libraries/LibLine/Editor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp
index f7450f7fe7..96c883c40b 100644
--- a/Userland/Libraries/LibLine/Editor.cpp
+++ b/Userland/Libraries/LibLine/Editor.cpp
@@ -316,8 +316,8 @@ void Editor::clear_line()
fputc(0x8, stderr);
fputs("\033[K", stderr);
fflush(stderr);
- m_buffer.clear();
m_chars_touched_in_the_middle = buffer().size();
+ m_buffer.clear();
m_cursor = 0;
m_inline_search_cursor = m_cursor;
}