1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

LibLine: Take the prompt into account when adjusting for a scrolled view

Otherwise we'd end up putting the prompt *after* the previous prompt
instead of *over* it when showing suggestions that span more lines than
are available without scrolling.
This commit is contained in:
Ali Mohammad Pur 2021-12-14 14:03:57 +03:30 committed by Ali Mohammad Pur
parent fa99125571
commit 86e1d1e73d
2 changed files with 9 additions and 8 deletions

View file

@ -1121,17 +1121,15 @@ void Editor::handle_read_event()
break;
}
if (m_times_tab_pressed > 1) {
if (m_suggestion_manager.count() > 0) {
if (m_suggestion_display->cleanup())
reposition_cursor(stderr_stream);
if (m_times_tab_pressed > 1 && m_suggestion_manager.count() > 0) {
if (m_suggestion_display->cleanup())
reposition_cursor(stderr_stream);
m_suggestion_display->set_initial_prompt_lines(m_prompt_lines_at_suggestion_initiation);
m_suggestion_display->set_initial_prompt_lines(m_prompt_lines_at_suggestion_initiation);
m_suggestion_display->display(m_suggestion_manager);
m_suggestion_display->display(m_suggestion_manager);
m_origin_row = m_suggestion_display->origin_row();
}
m_origin_row = m_suggestion_display->origin_row();
}
if (m_times_tab_pressed > 2) {