aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/xolox
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2011-08-31 23:27:53 +0200
committerPeter Odding <peter@peterodding.com>2011-08-31 23:27:53 +0200
commitd2a2cb54b84f6679c02e8634ec8db49eb368fe15 (patch)
tree1a0966d70b6c243e6be13d584302d13d6bd066b1 /autoload/xolox
parent2860329687750c271135e28e24fe5fc9034c9c74 (diff)
downloadvim-easytags-d2a2cb54b84f6679c02e8634ec8db49eb368fe15.tar.gz
Make "easytags_dynamic_files" create missing tags files
Suggested by Strahinja Marković in GitHub issue #15: https://github.com/xolox/vim-easytags/issues/15
Diffstat (limited to 'autoload/xolox')
-rw-r--r--autoload/xolox/easytags.vim20
1 files changed, 10 insertions, 10 deletions
diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim
index b234463..d859e4e 100644
--- a/autoload/xolox/easytags.vim
+++ b/autoload/xolox/easytags.vim
@@ -1,9 +1,9 @@
" Vim script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: August 27, 2011
+" Last Change: August 31, 2011
" URL: http://peterodding.com/code/vim/easytags/
-let g:xolox#easytags#version = '2.4.12'
+let g:xolox#easytags#version = '2.5'
" Public interface through (automatic) commands. {{{1
@@ -518,20 +518,20 @@ function! s:cache_tagged_files_in(fname, ftime, entries) " {{{3
endfunction
function! xolox#easytags#get_tagsfile() " {{{2
- " Look for a writable project specific tags file?
+ let tagsfile = ''
+ " Look for a suitable project specific tags file?
if xolox#misc#option#get('easytags_dynamic_files', 0)
- let files = tagfiles()
- if len(files) > 0 && filewritable(files[0]) == 1
- return files[0]
- endif
+ let tagsfile = xolox#misc#option#eval_tags(&tags, 1)
endif
- " Default to the global tags file.
- let tagsfile = expand(xolox#misc#option#get('easytags_file'))
" Check if a file type specific tags file is useful?
- if !empty(g:easytags_by_filetype) && index(xolox#easytags#supported_filetypes(), &ft) >= 0
+ if empty(tagsfile) && !empty(g:easytags_by_filetype) && index(xolox#easytags#supported_filetypes(), &ft) >= 0
let directory = xolox#misc#path#absolute(g:easytags_by_filetype)
let tagsfile = xolox#misc#path#merge(directory, &filetype)
endif
+ " Default to the global tags file?
+ if empty(tagsfile)
+ let tagsfile = expand(xolox#misc#option#get('easytags_file'))
+ endif
" If the tags file exists, make sure it is writable!
if filereadable(tagsfile) && filewritable(tagsfile) != 1
let message = "The tags file %s isn't writable!"