summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 1222b379..a8b161cb 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -433,6 +433,15 @@ public:
m_callback(line, PromptEvent::Change, context());
}
+ void set_prompt_colors(ColorPair colors)
+ {
+ if (colors != m_prompt_colors)
+ {
+ m_prompt_colors = colors;
+ display();
+ }
+ }
+
private:
void display() const
{
@@ -799,6 +808,13 @@ void InputHandler::prompt(const String& prompt, ColorPair prompt_colors,
completer, callback));
}
+void InputHandler::set_prompt_colors(ColorPair prompt_colors)
+{
+ InputModes::Prompt* prompt = dynamic_cast<InputModes::Prompt*>(m_mode.get());
+ if (prompt)
+ prompt->set_prompt_colors(prompt_colors);
+}
+
void InputHandler::menu(const memoryview<String>& choices,
MenuCallback callback)
{