Reset inputbox style if command mode is started or box cleared.
authorDaniel Carl <danielcarl@gmx.de>
Tue, 7 Jan 2014 23:45:28 +0000 (00:45 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Tue, 7 Jan 2014 23:45:28 +0000 (00:45 +0100)
If there was shown a error message in inputbox and the user starts to enter a
new command or presses <Esc>, the inputbox keeps red colored until the timeout
reset the style back to normal.
This patch uses the vb_echo* functions to put the text into the input box,
that will set the style explicit to 'normal'.

src/mode.c
src/normal.c

index f7e6d82..7146609 100644 (file)
@@ -110,7 +110,7 @@ void mode_enter_prompt(char id, const char *prompt, gboolean print_prompt)
     if (print_prompt) {
         /* set it after the mode was entered so that the modes input change
          * event listener could grep the new prompt */
-        vb_set_input_text(vb.state.prompt);
+        vb_echo_force(VB_MSG_NORMAL, false, vb.state.prompt);
     }
 }
 
index a401f41..b0bdd1e 100644 (file)
@@ -342,8 +342,8 @@ static char *transchar(int c)
 
 static VbResult normal_clear_input(const NormalCmdInfo *info)
 {
-    vb_set_input_text("");
     gtk_widget_grab_focus(GTK_WIDGET(vb.gui.webview));
+    vb_echo(VB_MSG_NORMAL, false, "");
     command_search(&((Arg){0}));
 
     return RESULT_COMPLETE;