From: Daniel Carl <danielcarl@gmx.de>
Date: Sun, 31 Aug 2014 22:42:01 +0000 (+0200)
Subject: Don't put autocmd commands in history.
X-Git-Url: https://git.owens.tech/assets/112-editable-focus.html/assets/112-editable-focus.html/git?a=commitdiff_plain;h=f750207c2a8d021cb390c54a93b1f74140319e33;p=vimb.git

Don't put autocmd commands in history.
---

diff --git a/src/autocmd.c b/src/autocmd.c
index f08e2f9..1d69a7e 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -47,6 +47,8 @@ static struct {
     {"PageLoadFailed",      0x0010},
 };
 
+extern VbCore vb;
+
 static AuGroup *curgroup = NULL;
 static GSList  *groups = NULL;
 
@@ -205,6 +207,9 @@ gboolean autocmd_run(const char *group, AuEvent event, const char *uri)
     AutoCmd *cmd;
     guint bits = events[event].bits;
 
+    /* don't record commands in history runed by autocmd */
+    vb.state.enable_history = false;
+
     /* loop over the groups and find matching commands */
     for (lg = groups; lg; lg = lg->next) {
         grp = lg->data;
@@ -229,6 +234,7 @@ gboolean autocmd_run(const char *group, AuEvent event, const char *uri)
             ex_run_string(cmd->excmd);
         }
     }
+    vb.state.enable_history = true;
 
     return true;
 }