summaryrefslogtreecommitdiff
path: root/src/dwb.c
diff options
context:
space:
mode:
authorportix <none@none>2013-01-11 18:08:48 +0100
committerportix <none@none>2013-01-11 18:08:48 +0100
commit316df269e03372433698eb843c6a881cd4249665 (patch)
tree1118bc3d8c322efef35aacd6457741d6c5944efd /src/dwb.c
parent5120a25141eae3fadeeeb2eca54f9f902c9056ed (diff)
downloaddwb-316df269e03372433698eb843c6a881cd4249665.zip
Clear textentry when calling io_prompt
Diffstat (limited to 'src/dwb.c')
-rw-r--r--src/dwb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/dwb.c b/src/dwb.c
index 43e7d2c6..e4923608 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -596,7 +596,7 @@ dwb_set_normal_message(GList *gl, gboolean hide, const char *text, ...)
if (gl != dwb.state.fview)
return;
- char message[STRING_LENGTH];
+ char message[STRING_LENGTH] = {0};
va_list arg_list;
va_start(arg_list, text);
@@ -2320,9 +2320,10 @@ dwb_confirm(GList *gl, char *prompt, ...)
}/*}}}*/
/* dwb_prompt {{{*/
-const char *
+char *
dwb_prompt(gboolean visibility, char *prompt, ...)
{
+ char *result = NULL;
dwb.state.mode |= CONFIRM;
va_list arg_list;
char message[STRING_LENGTH];
@@ -2351,8 +2352,13 @@ dwb_prompt(gboolean visibility, char *prompt, ...)
dwb_focus_scroll(dwb.state.fview);
CLEAR_COMMAND_TEXT();
+
+ if (state == 0)
+ result = g_strdup(GET_TEXT());
+
+ gtk_editable_delete_text(GTK_EDITABLE(dwb.gui.entry), 0, -1);
gtk_entry_set_visibility(GTK_ENTRY(dwb.gui.entry), true);
- return state == 0 ? GET_TEXT() : NULL;
+ return result;
}/*}}}*/
/* dwb_save_quickmark(const char *key) {{{*/