瀏覽代碼

LibLine: Note that the search() call modifies the buffer

Fixes #5465.
AnotherTest 4 年之前
父節點
當前提交
71de5433f8
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/Libraries/LibLine/Editor.cpp

+ 2 - 0
Userland/Libraries/LibLine/Editor.cpp

@@ -1095,6 +1095,8 @@ bool Editor::search(const StringView& phrase, bool allow_empty, bool from_beginn
     }
     }
 
 
     if (found) {
     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_buffer.clear();
         m_cursor = 0;
         m_cursor = 0;
         insert(m_history[last_matching_offset].entry);
         insert(m_history[last_matching_offset].entry);