From: Daniel Carl Date: Sat, 22 Nov 2014 21:41:26 +0000 (+0100) Subject: Don't record commands given by --cmd option. X-Git-Url: https://git.owens.tech/assets/static/gitweb.css/assets/static/gitweb.css/git?a=commitdiff_plain;h=acf7fa0acd848ef0351f16f820eae977c4c64518;p=vimb.git Don't record commands given by --cmd option. We don't want to record startup commands in the command history. --- diff --git a/src/main.c b/src/main.c index 342c7d5..837e01e 100644 --- a/src/main.c +++ b/src/main.c @@ -842,11 +842,6 @@ static void init_core(void) gtk_box_pack_end(gui->box, gui->input, false, false, 0); #endif - /* init some state variable */ - vb.state.enable_register = false; - vb.state.enable_history = false; - vb.state.uri = g_strdup(""); - /* initialize the modes */ mode_init(); if (!vb.config.kioskmode) { @@ -892,8 +887,6 @@ static void init_core(void) } /* enter normal mode */ - vb.state.enable_register = true; - vb.state.enable_history = true; mode_enter('n'); vb.config.default_zoom = 1.0; @@ -1563,6 +1556,11 @@ int main(int argc, char *argv[]) g_setenv("VIMB_PID", pid, true); g_free(pid); + /* init some state variable */ + vb.state.enable_register = false; + vb.state.enable_history = false; + vb.state.uri = g_strdup(""); + init_core(); /* process the --cmd if this was given */ @@ -1570,6 +1568,10 @@ int main(int argc, char *argv[]) ex_run_string(l->data); } + /* active the registers and writing of command history */ + vb.state.enable_register = true; + vb.state.enable_history = true; + /* open uri given as last argument */ if (argc <= 1) { /* open configured home page if no uri was given */