aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/xolox
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2013-04-30 23:37:17 +0200
committerPeter Odding <peter@peterodding.com>2013-04-30 23:37:17 +0200
commit1aae392a30ed478f706c2e19e15df858991adb79 (patch)
tree7340b163c8690eb24765eccebf0d0eac11b5e8f3 /autoload/xolox
parentc455d6e1beae13ccf2ddee925a5f9ab2008ef125 (diff)
downloadvim-easytags-1aae392a30ed478f706c2e19e15df858991adb79.tar.gz
Don't try to use dynamic tags files for non-writable directories (issue #29)
This fixes the problem described here: https://github.com/xolox/vim-easytags/issues/29
Diffstat (limited to 'autoload/xolox')
-rw-r--r--autoload/xolox/easytags.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim
index c22f1cf..adf243c 100644
--- a/autoload/xolox/easytags.vim
+++ b/autoload/xolox/easytags.vim
@@ -3,7 +3,7 @@
" Last Change: April 30, 2013
" URL: http://peterodding.com/code/vim/easytags/
-let g:xolox#easytags#version = '3.1.7'
+let g:xolox#easytags#version = '3.1.8'
call xolox#misc#compat#check('easytags', 2)
@@ -651,6 +651,13 @@ function! xolox#easytags#get_tagsfile() " {{{2
let tagsfile = get(tagfiles(), 0, '')
elseif dynamic_files == 2
let tagsfile = xolox#misc#option#eval_tags(&tags, 1)
+ let directory = fnamemodify(tagsfile, ':h')
+ if filewritable(directory) != 2
+ " If the directory of the dynamic tags file is not writable, we fall
+ " back to a file type specific tags file or the global tags file.
+ call xolox#misc#msg#warn("easytags.vim %s: Dynamic tags files enabled but %s not writable so falling back.", g:xolox#easytags#version, directory)
+ let tagsfile = ''
+ endif
endif
" Check if a file type specific tags file is useful?
if empty(tagsfile) && !empty(g:easytags_by_filetype) && index(xolox#easytags#supported_filetypes(), &ft) >= 0