From: Daniel Carl Date: Tue, 7 Jan 2014 23:45:28 +0000 (+0100) Subject: Reset inputbox style if command mode is started or box cleared. X-Git-Url: https://git.owens.tech/112-editable-focus.html/112-editable-focus.html/git?a=commitdiff_plain;h=17f15dfec3f6c4d21d1d3d26db94524789b3e4e6;p=vimb.git Reset inputbox style if command mode is started or box cleared. If there was shown a error message in inputbox and the user starts to enter a new command or presses , 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'. --- diff --git a/src/mode.c b/src/mode.c index f7e6d82..7146609 100644 --- a/src/mode.c +++ b/src/mode.c @@ -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); } } diff --git a/src/normal.c b/src/normal.c index a401f41..b0bdd1e 100644 --- a/src/normal.c +++ b/src/normal.c @@ -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;