mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-26 12:17:52 +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:
parent
fa99125571
commit
86e1d1e73d
Notes:
sideshowbarker
2024-07-17 22:45:38 +09:00
Author: https://github.com/alimpfard
Commit: 86e1d1e73d
Pull-request: https://github.com/SerenityOS/serenity/pull/11255
2 changed files with 9 additions and 8 deletions
|
@ -126,6 +126,9 @@ void XtermSuggestionDisplay::display(const SuggestionManager& manager)
|
|||
|
||||
m_lines_used_for_last_suggestions = lines_used;
|
||||
|
||||
// The last line of the prompt is the same line as the first line of the buffer, so we need to subtract one here.
|
||||
lines_used += m_prompt_lines_at_suggestion_initiation - 1;
|
||||
|
||||
// If we filled the screen, move back the origin.
|
||||
if (m_origin_row + lines_used >= m_num_lines) {
|
||||
m_origin_row = m_num_lines - lines_used;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue