summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibLine/Editor.cpp
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-04-19 12:43:36 +0430
committerLinus Groh <mail@linusgroh.de>2021-04-19 16:28:33 +0200
commite1e84fe0fef8a844bb54d07258c32e24ef1f96d5 (patch)
tree267cb429920884037d3a5b004701932191b89ae7 /Userland/Libraries/LibLine/Editor.cpp
parent3cfab83e7e87ec062c717259e0f1c16f3b579a89 (diff)
downloadserenity-e1e84fe0fef8a844bb54d07258c32e24ef1f96d5.zip
LibLine: Redraw the suggestions when terminal size changes
Diffstat (limited to 'Userland/Libraries/LibLine/Editor.cpp')
-rw-r--r--Userland/Libraries/LibLine/Editor.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp
index d66cfde642..0f0a12b184 100644
--- a/Userland/Libraries/LibLine/Editor.cpp
+++ b/Userland/Libraries/LibLine/Editor.cpp
@@ -576,6 +576,20 @@ void Editor::interrupted()
});
}
+void Editor::resized()
+{
+ m_was_resized = true;
+ m_previous_num_columns = m_num_columns;
+ get_terminal_size();
+
+ reposition_cursor(true);
+ m_suggestion_display->redisplay(m_suggestion_manager, m_num_lines, m_num_columns);
+ reposition_cursor();
+
+ if (m_is_searching)
+ m_search_editor->resized();
+}
+
void Editor::really_quit_event_loop()
{
m_finish = false;