}
/* run the command */
/* TODO shoult the result be tested for RESULT_COMPLETE? */
- ex_run_string(cmd->excmd);
+ /* run command and make sure it's not writte to command history */
+ ex_run_string(cmd->excmd, false);
}
}
case ':':
mode_enter('n');
- res = ex_run_string(cmd);
+ res = ex_run_string(cmd, true);
if (!(res & VB_CMD_KEEPINPUT)) {
/* clear input on success if this is not explicit ommited */
vb_set_input_text("");
g_free(text);
}
-VbCmdResult ex_run_string(const char *input)
+VbCmdResult ex_run_string(const char *input, gboolean enable_history)
{
/* copy to have original command for history */
const char *in = input;
}
}
- if (!nohist) {
+ if (enable_history && !nohist) {
history_add(HISTORY_COMMAND, input, NULL);
vb_register_add(':', input);
}
VbResult ex_keypress(int key);
void ex_input_changed(const char *text);
gboolean ex_fill_completion(GtkListStore *store, const char *input);
-VbCmdResult ex_run_string(const char *input);
+VbCmdResult ex_run_string(const char *input, gboolean enable_history);
#endif /* end of include guard: _EX_H */
if (*line == '#') {
continue;
}
- if (ex_run_string(line) & VB_CMD_ERROR ) {
+ if (ex_run_string(line, false) & VB_CMD_ERROR ) {
g_warning("Invalid user config: '%s'", line);
}
}
/* process the --cmd if this was given */
for (GSList *l = vb.config.cmdargs; l; l = l->next) {
- ex_run_string(l->data);
+ ex_run_string(l->data, false);
}
/* active the registers and writing of command history */