If a too long history items was displayed we put also the cursor to the end of
the value. But this causes that the first, and potentially more interesting
part was hidden. Now we place the cursor to the beginning, if the printed
content in inputbox is too long.
#include "history.h"
extern VbCore vb;
+extern const unsigned int INPUT_LENGTH;
+
static CommandInfo cmd_list[] = {
/* command function arg mode */
{"open", command_open, {VB_TARGET_CURRENT, ""}},
/* insert string from arg */
gtk_editable_insert_text(box, str, -1, &pos);
- gtk_editable_set_position(box, -1);
+ gtk_editable_set_position(box, strlen(str) > INPUT_LENGTH ? 0 : -1);
}
#define SETTING_MAX_CONNS 25
#define 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 struct {