From f38bcf6e2deb821d94dac3609aaa3ffc79d01f8c Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Sun, 4 Sep 2011 13:33:32 +0200 Subject: Bug fix for "E713: Cannot use empty key for Dictionary" (issue #16) --- autoload/xolox/easytags.vim | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim index d859e4e..f077dbc 100644 --- a/autoload/xolox/easytags.vim +++ b/autoload/xolox/easytags.vim @@ -1,9 +1,9 @@ " Vim script " Author: Peter Odding -" Last Change: August 31, 2011 +" Last Change: September 4, 2011 " URL: http://peterodding.com/code/vim/easytags/ -let g:xolox#easytags#version = '2.5' +let g:xolox#easytags#version = '2.5.1' " Public interface through (automatic) commands. {{{1 @@ -243,8 +243,10 @@ function! s:find_tagged_files(entries) " {{{3 let tagged_files = {} for entry in a:entries let filename = s:canonicalize(entry[1]) - if !has_key(tagged_files, filename) - let tagged_files[filename] = 1 + if filename != '' + if !has_key(tagged_files, filename) + let tagged_files[filename] = 1 + endif endif endfor return tagged_files @@ -512,7 +514,10 @@ endfunction function! s:cache_tagged_files_in(fname, ftime, entries) " {{{3 for entry in a:entries - let s:tagged_files[s:canonicalize(entry[1])] = 1 + let filename = s:canonicalize(entry[1]) + if filename != '' + let s:tagged_files[filename] = 1 + endif endfor let s:known_tagfiles[a:fname] = a:ftime endfunction @@ -607,13 +612,16 @@ function! s:resolve(filename) " {{{2 endfunction function! s:canonicalize(filename) " {{{2 - if has_key(s:cached_filenames, a:filename) - return s:cached_filenames[a:filename] - endif - let canonical = s:resolve(fnamemodify(a:filename, ':p')) - let s:cached_filenames[a:filename] = canonical - return canonical + if a:filename != '' + if has_key(s:cached_filenames, a:filename) + return s:cached_filenames[a:filename] + endif + let canonical = s:resolve(fnamemodify(a:filename, ':p')) + let s:cached_filenames[a:filename] = canonical + return canonical + endif endif + return '' endfunction let s:cached_filenames = {} -- cgit v1.2.3