aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--autoload/xolox/easytags.vim12
-rw-r--r--plugin/easytags.vim7
2 files changed, 18 insertions, 1 deletions
diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim
index 4de7b1f..9524570 100644
--- a/autoload/xolox/easytags.vim
+++ b/autoload/xolox/easytags.vim
@@ -408,6 +408,18 @@ function! xolox#easytags#async_callback(response) " {{{2
endif
endfunction
+function! xolox#easytags#disable_automatic_updates() " {{{2
+ let s:easytags_auto_update_save = xolox#misc#option#get('easytags_auto_update', 1)
+ let g:easytags_auto_update = 0
+endfunction
+
+function! xolox#easytags#restore_automatic_updates() " {{{2
+ if exists('s:easytags_auto_update_save')
+ let g:easytags_auto_update = s:easytags_auto_update_save
+ unlet s:easytags_auto_update_save
+ else
+endfunction
+
" Public API for definition of file type specific dynamic syntax highlighting. {{{1
function! xolox#easytags#define_tagkind(object) " {{{2
diff --git a/plugin/easytags.vim b/plugin/easytags.vim
index a20b85c..4da7962 100644
--- a/plugin/easytags.vim
+++ b/plugin/easytags.vim
@@ -1,6 +1,6 @@
" Vim plug-in
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: June 22, 2014
+" Last Change: June 29, 2014
" URL: http://peterodding.com/code/vim/easytags/
" Requires: Exuberant Ctags (http://ctags.sf.net)
@@ -122,6 +122,11 @@ augroup PluginEasyTags
" After reloading a buffer the dynamic syntax highlighting is lost. The
" following code makes sure the highlighting is refreshed afterwards.
autocmd BufReadPost * unlet! b:easytags_last_highlighted
+ " During :vimgrep each searched buffer triggers an asynchronous tags file
+ " update resulting in races for the tags file. To avoid this we temporarily
+ " disable automatic tags file updates during :vimgrep.
+ "autocmd QuickFixCmdPre *vimgrep* call xolox#easytags#disable_automatic_updates()
+ "autocmd QuickFixCmdPost *vimgrep* call xolox#easytags#restore_automatic_updates()
augroup END
" Use vim-misc to register an event handler for Vim's CursorHold and