summaryrefslogtreecommitdiff
path: root/Libraries/LibLine/SuggestionDisplay.h
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-06-29 20:08:02 +0430
committerAndreas Kling <kling@serenityos.org>2020-06-30 18:21:44 +0200
commitf20becf71b89e1caac65a06d69c57362847c1c94 (patch)
tree4ecb16224f436b7c2da0380c903cd715d500360e /Libraries/LibLine/SuggestionDisplay.h
parent0fc8931d5f5105f17eabc462e68783689d6649a1 (diff)
downloadserenity-f20becf71b89e1caac65a06d69c57362847c1c94.zip
LibLine: Correctly display suggestions on multiline prompts
Diffstat (limited to 'Libraries/LibLine/SuggestionDisplay.h')
-rw-r--r--Libraries/LibLine/SuggestionDisplay.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Libraries/LibLine/SuggestionDisplay.h b/Libraries/LibLine/SuggestionDisplay.h
index 346ee4bc59..80606bc5fc 100644
--- a/Libraries/LibLine/SuggestionDisplay.h
+++ b/Libraries/LibLine/SuggestionDisplay.h
@@ -28,6 +28,7 @@
#include <AK/Forward.h>
#include <AK/String.h>
+#include <LibLine/StringMetrics.h>
#include <LibLine/SuggestionManager.h>
#include <stdlib.h>
@@ -61,9 +62,10 @@ protected:
class XtermSuggestionDisplay : public SuggestionDisplay {
public:
- XtermSuggestionDisplay(size_t lines, size_t columns)
+ XtermSuggestionDisplay(size_t lines, size_t columns, const StringMetrics& prompt_metrics)
: m_num_lines(lines)
, m_num_columns(columns)
+ , m_prompt_metrics(prompt_metrics)
{
}
virtual ~XtermSuggestionDisplay() override { }
@@ -92,7 +94,7 @@ private:
size_t m_num_lines { 0 };
size_t m_num_columns { 0 };
size_t m_prompt_lines_at_suggestion_initiation { 0 };
- size_t m_prompt_length { 0 };
+ const StringMetrics& m_prompt_metrics;
struct PageRange {
size_t start;