Skip to content

Commit

Permalink
Bug fix for strange "E433: No tags file" problem
Browse files Browse the repository at this point in the history
The plug-in is supposed to automatically register the global tags file
with Vim by setting the "tags" option but this didn't work because of
what's probably a bug in Vim: When you set the "tags" option using the
following syntax, Vim will fail to add the new tags file:

    let &tags = ...

But when you switch to the following syntax it works:

    :set tags=...
  • Loading branch information
xolox committed Jul 10, 2010
1 parent 92cd87d commit 4fef0c1
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions easytags.vim
@@ -1,10 +1,10 @@
" Vim plug-in
" Maintainer: Peter Odding <peter@peterodding.com>
" Last Change: June 15, 2010
" Last Change: July 10, 2010
" URL: http://peterodding.com/code/vim/easytags
" Requires: Exuberant Ctags (http://ctags.sf.net)
" License: MIT
" Version: 1.9.3
" Version: 1.9.6

" Support for automatic update using the GLVS plug-in.
" GetLatestVimScripts: 3114 1 :AutoInstall: easytags.zip
Expand Down Expand Up @@ -102,19 +102,15 @@ endif
" Parse the &tags option and get a list of all configured tags files including
" non-existing files (this is why we can't just call the tagfiles() function).
let s:tagfiles = xolox#option#split_tags(&tags)
let s:expanded = map(copy(s:tagfiles), 'expand(v:val)')
let s:expanded = map(copy(s:tagfiles), 'resolve(expand(v:val))')

" Add the tags file to the &tags option when the user hasn't done so already.
if index(s:expanded, expand(g:easytags_file)) == -1
let s:entry = g:easytags_file
if (has('win32') || has('win64')) && s:entry =~ '^\~[\\/]'
" On UNIX you can use ~/ in &tags but on Windows that doesn't work.
let s:entry = expand(s:entry)
endif
let &tags = xolox#option#join_tags(insert(s:tagfiles, s:entry, 0))
if index(s:expanded, resolve(expand(g:easytags_file))) == -1
let s:value = substitute(expand(g:easytags_file), '[\\, ]', '\\\0', 'g')
execute 'set tags=' . s:value . ',' . &tags
endif

unlet! s:tagfiles s:expanded s:entry
unlet! s:tagfiles s:expanded s:value

" The :UpdateTags and :HighlightTags commands. {{{1

Expand Down

0 comments on commit 4fef0c1

Please sign in to comment.