diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-05-22 14:02:17 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-23 01:31:41 +0200 |
commit | 3c3edf583116037f43e1e031f6f7ade6d7c55709 (patch) | |
tree | dece737c58588b0837185ddd73cbcb6084852604 /Libraries/LibLine/Editor.cpp | |
parent | 0446b7e347f20062f8a560c51bee7cf8182a6a7c (diff) | |
download | serenity-3c3edf583116037f43e1e031f6f7ade6d7c55709.zip |
LibLine: Properly paginate suggestions in XtermSuggestionDisplay
This commit adds back suggestion pagination, and makes it 10x better.
Also adds a "< page m of n >" indicator at the bottom if there are more
suggestions than would fit in a page.
It properly handles cycling forwards and backwards :^)
Diffstat (limited to 'Libraries/LibLine/Editor.cpp')
-rw-r--r-- | Libraries/LibLine/Editor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp index db63696561..18d691eb44 100644 --- a/Libraries/LibLine/Editor.cpp +++ b/Libraries/LibLine/Editor.cpp @@ -566,6 +566,7 @@ String Editor::get_line(const String& prompt) suggest(0, 0, Span::CodepointOriented); m_times_tab_pressed = 0; m_suggestion_manager.reset(); + m_suggestion_display->finish(); } continue; } @@ -582,6 +583,7 @@ String Editor::get_line(const String& prompt) } m_suggestion_manager.reset(); suggest(0, 0, Span::CodepointOriented); + m_suggestion_display->finish(); } m_times_tab_pressed = 0; // Safe to say if we get here, the user didn't press TAB |