aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/xolox/easytags.vim
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2011-07-09 00:51:28 +0200
committerPeter Odding <peter@peterodding.com>2011-07-09 00:51:28 +0200
commitba99f5f17c2a80637377d01b5f124abb5b7f74cc (patch)
tree26ab49ca1413c1262a6e74aa23c7c5a5692b9fea /autoload/xolox/easytags.vim
parentee0966c041bb48e9b2537ed36e09666be1f1f45f (diff)
downloadvim-easytags-ba99f5f17c2a80637377d01b5f124abb5b7f74cc.tar.gz
Skip unreadable tags files returned by tagfiles() (reported by Hannes von Haugwitz)
Diffstat (limited to 'autoload/xolox/easytags.vim')
-rw-r--r--autoload/xolox/easytags.vim14
1 files changed, 9 insertions, 5 deletions
diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim
index 03bb05d..038a3ae 100644
--- a/autoload/xolox/easytags.vim
+++ b/autoload/xolox/easytags.vim
@@ -493,11 +493,15 @@ function! s:cache_tagged_files() " {{{3
" other purposes anyway (so the cache doesn't introduce too much overhead).
let starttime = xolox#misc#timer#start()
for tagsfile in tagfiles()
- let fname = s:canonicalize(tagsfile)
- let ftime = getftime(fname)
- if get(s:known_tagfiles, fname, 0) != ftime
- let [headers, entries] = xolox#easytags#read_tagsfile(fname)
- call s:cache_tagged_files_in(fname, ftime, entries)
+ if !filereadable(tagsfile)
+ call xolox#misc#msg#warn("easytags.vim %s: Skipping unreadable tags file %s!", fname)
+ else
+ let fname = s:canonicalize(tagsfile)
+ let ftime = getftime(fname)
+ if get(s:known_tagfiles, fname, 0) != ftime
+ let [headers, entries] = xolox#easytags#read_tagsfile(fname)
+ call s:cache_tagged_files_in(fname, ftime, entries)
+ endif
endif
endfor
call xolox#misc#timer#stop("easytags.vim %s: Initialized cache of tagged files in %s.", g:easytags_version, starttime)