From 3b934f6e0d0d4a44875024713dd0aeefdcdd206b Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Tue, 20 Jul 2010 12:47:39 +0200 Subject: Another bug fix for the broken :set tags= command Previously* I fixed a bug where easytags.vim failed to register the global tags file created by the plug-in with Vim, because even though the &tags option was set by the plug-in, Vim would refuse to acknowledge the new tags file, i.e. tagfiles() == []. The fix then was to change :let &tags= to :set tags= which apparently has a different implementation from :let &tags=?! I assumed this fix would be valid for both Windows and UNIX, but apparently this still doesn't work on Windows! There we actually have to use feedkeys() to convince Vim to change the &tags option... What a hack! :-( BTW I also fixed an embarrassing typo in the initialization code. * Bug fix for strange "E433: No tags file" problem: http://github.com/xolox/vim-easytags/commit/4fef0c17749e687d670b2e9e4e429022ec4c1055 --- autoload.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'autoload.vim') diff --git a/autoload.vim b/autoload.vim index 847c0d2..8d3462b 100644 --- a/autoload.vim +++ b/autoload.vim @@ -1,6 +1,6 @@ " Vim script " Author: Peter Odding -" Last Change: July 18, 2010 +" Last Change: July 20, 2010 " URL: http://peterodding.com/code/vim/easytags/ let s:script = expand(':p:~') @@ -78,7 +78,7 @@ function! easytags#update_cmd(filter_invalid_tags) " {{{2 let listing = system(join(command)) if v:shell_error let msg = "Failed to update tags file %s: %s!" - throw printf(msg, fnamemodify(tagsfile, ':~'), strtrans(v:exception)) + throw printf(msg, fnamemodify(tagsfile, ':~'), strtrans(listing)) endif call easytags#add_tagged_file(filename) let msg = "%s: Updated tags for %s in %s." @@ -151,8 +151,8 @@ function! easytags#supported_filetypes() " {{{2 endif let s:supported_filetypes = split(listing, '\n') call map(s:supported_filetypes, 'easytags#to_vim_ft(v:val)') - let msg = "%s: Retrieved supported languages in %s." - call xolox#timer#stop(msg, s:script, start) + let msg = "%s: Retrieved %i supported languages in %s." + call xolox#timer#stop(msg, s:script, len(s:supported_filetypes), start) endif return s:supported_filetypes endfunction @@ -283,6 +283,8 @@ function! s:cache_tagged_files() " {{{2 endfunction function! s:set_tagged_files(entries) " {{{2 + " TODO use taglist() instead of readfile() so that all tag files are + " automatically used :-) let s:tagged_files = {} for entry in a:entries let filename = matchstr(entry, '^[^\t]\+\t\zs[^\t]\+') -- cgit v1.2.3