summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-02-24 10:17:42 +0330
committerAndreas Kling <kling@serenityos.org>2021-02-24 12:19:20 +0100
commit71de5433f8b2c97ccc289b656a626b070b744a47 (patch)
tree9870c710469240cf477ef8ff8d06837f64756048 /Userland
parentdd87b14f52267f36dcad9ce3ddde4b622ea607ce (diff)
downloadserenity-71de5433f8b2c97ccc289b656a626b070b744a47.zip
LibLine: Note that the search() call modifies the buffer
Fixes #5465.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibLine/Editor.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp
index 3e0dac4665..f7450f7fe7 100644
--- a/Userland/Libraries/LibLine/Editor.cpp
+++ b/Userland/Libraries/LibLine/Editor.cpp
@@ -1095,6 +1095,8 @@ bool Editor::search(const StringView& phrase, bool allow_empty, bool from_beginn
}
if (found) {
+ // We plan to clear the buffer, so mark the entire thing touched.
+ m_chars_touched_in_the_middle = m_buffer.size();
m_buffer.clear();
m_cursor = 0;
insert(m_history[last_matching_offset].entry);