diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp index 5c302bfaf7..e72977b0ea 100644 --- a/Libraries/LibLine/Editor.cpp +++ b/Libraries/LibLine/Editor.cpp @@ -1036,13 +1036,6 @@ void Editor::refresh_display() } m_was_resized = false; } - // Do not call hook on pure cursor movement. - if (m_cached_prompt_valid && !m_refresh_needed && m_pending_chars.size() == 0) { - // Probably just moving around. - reposition_cursor(); - m_cached_buffer_metrics = actual_rendered_string_metrics(buffer_view()); - return; - } // We might be at the last line, and have more than one line; // Refreshing the display will cause the terminal to scroll, // so note that fact and bring origin up. @@ -1053,6 +1046,13 @@ void Editor::refresh_display() else m_origin_row = m_num_lines - current_num_lines + 1; } + // Do not call hook on pure cursor movement. + if (m_cached_prompt_valid && !m_refresh_needed && m_pending_chars.size() == 0) { + // Probably just moving around. + reposition_cursor(); + m_cached_buffer_metrics = actual_rendered_string_metrics(buffer_view()); + return; + } if (on_display_refresh) on_display_refresh(*this);