Commits

ZyX_I committed 74e509f

autoload/aurum: Do not allow multiple BufWritePost events for one buffer in AuInvalidateStatusCache group

Comments (0)

Files changed (1)

autoload/aurum.vim

         return {}
     endif
     let relname=s:F.reltorepo(repo)
-    augroup AuInvalidateStatusCache
-        autocmd BufWritePost <buffer> :call s:_r.cache.del('status')
-    augroup END
+    let buf=bufnr('%')
+    if !has_key(s:_r.cachebvars, buf) || !has_key(s:_r.cachebvars[buf], 'status')
+        augroup AuInvalidateStatusCache
+            autocmd! BufWritePost <buffer> :call s:_r.cache.del('status')
+        augroup END
+    endif
     return get(keys(filter(copy(s:_r.cache.get('status', repo.functions.status,
                 \                              [repo, 0, 0, [relname]],
                 \                              {})),