diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-02-24 09:33:26 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-24 12:19:20 +0100 |
commit | 21cbcdd7da3c7348b2cb518a43922003f55d4c9f (patch) | |
tree | 078808da22268f69bd8d934014d3f935af363d33 /Userland | |
parent | bf68939bcc6b8183541375ac8afd07ac18393ae6 (diff) | |
download | serenity-21cbcdd7da3c7348b2cb518a43922003f55d4c9f.zip |
LibLine: Properly update the main editor when clearing the search editor
This broke after the lazy update change :P
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibLine/InternalFunctions.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Userland/Libraries/LibLine/InternalFunctions.cpp b/Userland/Libraries/LibLine/InternalFunctions.cpp index fa8d95da5c..162e01dbee 100644 --- a/Userland/Libraries/LibLine/InternalFunctions.cpp +++ b/Userland/Libraries/LibLine/InternalFunctions.cpp @@ -25,6 +25,7 @@ */ #include <AK/StringBuilder.h> +#include <AK/TemporaryChange.h> #include <LibLine/Editor.h> #include <ctype.h> #include <stdio.h> @@ -260,7 +261,7 @@ void Editor::enter_search() // Move the search prompt below ours and tell it to redraw itself. auto prompt_end_line = current_prompt_metrics().lines_with_addition(m_cached_buffer_metrics, m_num_columns); - search_editor.set_origin(prompt_end_line + 1, 1); + search_editor.set_origin(prompt_end_line + m_origin_row, 1); search_editor.m_refresh_needed = true; }; @@ -300,9 +301,12 @@ void Editor::enter_search() fprintf(stderr, "\033[3J\033[H\033[2J"); // Clear screen. // refresh our own prompt - set_origin(1, 1); - m_refresh_needed = true; - refresh_display(); + { + TemporaryChange refresh_change { m_always_refresh, true }; + set_origin(1, 1); + m_refresh_needed = true; + refresh_display(); + } // move the search prompt below ours // and tell it to redraw itself |