comp.text = g_strdup_printf("%s%s", comp.prefix, value);
}
/* print the text also into inputbox */
- vb_echo_force(VB_MSG_NORMAL, false, "%s", comp.text);
+ PUT_TEXT(comp.text);
g_free(value);
}
#define MESSAGE_TIMEOUT 5
const unsigned int SETTING_MAX_CONNS = 25;
const unsigned int SETTING_MAX_CONNS_PER_HOST = 5;
-
-/* number of chars in inputbox - if completion or stepping through history
- * print values longer this value, the cursor will be placed to the beginning
- * so that the command part will be visible */
-const unsigned int INPUT_LENGTH = 120;
const unsigned int MAXIMUM_HINTS = 500;
const char *default_config[] = {
vb.state.input_type = type;
vb_update_input_style();
}
- gtk_entry_set_text(GTK_ENTRY(vb.gui.inputbox), message);
- gtk_editable_set_position(GTK_EDITABLE(vb.gui.inputbox), strlen(message) > INPUT_LENGTH ? 0 : -1);
+ PUT_TEXT(message);
if (hide) {
g_timeout_add_seconds(MESSAGE_TIMEOUT, (GSourceFunc)hide_message, NULL);
}
#endif
#define GET_TEXT() (gtk_entry_get_text(GTK_ENTRY(vb.gui.inputbox)))
+#define PUT_TEXT(x) { \
+ gtk_entry_set_text(GTK_ENTRY(vb.gui.inputbox), x); \
+ gtk_editable_set_position(GTK_EDITABLE(vb.gui.inputbox), -1); \
+}
#define GET_URI() (webkit_web_view_get_uri(vb.gui.webview))
#define CLEAN_MODE(mode) ((mode) & ~(VB_MODE_COMPLETE | VB_MODE_SEARCH | VB_MODE_HINTING))
#define CLEAR_INPUT() (vb_echo(VB_MSG_NORMAL, ""))