From f750207c2a8d021cb390c54a93b1f74140319e33 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Mon, 1 Sep 2014 00:42:01 +0200
Subject: [PATCH] Don't put autocmd commands in history.

---
 src/autocmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

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;
 }
-- 
2.20.1