Skip to content
This repository
Browse code

Bug fix for "E713: Cannot use empty key for Dictionary" (issue #16)

  • Loading branch information...
commit f38bcf6e2deb821d94dac3609aaa3ffc79d01f8c 1 parent 8a186f4
Peter Odding authored September 04, 2011

Showing 1 changed file with 19 additions and 11 deletions. Show diff stats Hide diff stats

  1. 30  autoload/xolox/easytags.vim
30  autoload/xolox/easytags.vim
... ...
@@ -1,9 +1,9 @@
1 1
 " Vim script
2 2
 " Author: Peter Odding <peter@peterodding.com>
3  
-" Last Change: August 31, 2011
  3
+" Last Change: September 4, 2011
4 4
 " URL: http://peterodding.com/code/vim/easytags/
5 5
 
6  
-let g:xolox#easytags#version = '2.5'
  6
+let g:xolox#easytags#version = '2.5.1'
7 7
 
8 8
 " Public interface through (automatic) commands. {{{1
9 9
 
@@ -243,8 +243,10 @@ function! s:find_tagged_files(entries) " {{{3
243 243
   let tagged_files = {}
244 244
   for entry in a:entries
245 245
     let filename = s:canonicalize(entry[1])
246  
-    if !has_key(tagged_files, filename)
247  
-      let tagged_files[filename] = 1
  246
+    if filename != ''
  247
+      if !has_key(tagged_files, filename)
  248
+        let tagged_files[filename] = 1
  249
+      endif
248 250
     endif
249 251
   endfor
250 252
   return tagged_files
@@ -512,7 +514,10 @@ endfunction
512 514
 
513 515
 function! s:cache_tagged_files_in(fname, ftime, entries) " {{{3
514 516
   for entry in a:entries
515  
-    let s:tagged_files[s:canonicalize(entry[1])] = 1
  517
+    let filename = s:canonicalize(entry[1])
  518
+    if filename != ''
  519
+      let s:tagged_files[filename] = 1
  520
+    endif
516 521
   endfor
517 522
   let s:known_tagfiles[a:fname] = a:ftime
518 523
 endfunction
@@ -607,13 +612,16 @@ function! s:resolve(filename) " {{{2
607 612
 endfunction
608 613
 
609 614
 function! s:canonicalize(filename) " {{{2
610  
-  if has_key(s:cached_filenames, a:filename)
611  
-    return s:cached_filenames[a:filename]
612  
-  endif
613  
-    let canonical = s:resolve(fnamemodify(a:filename, ':p'))
614  
-    let s:cached_filenames[a:filename] = canonical
615  
-    return canonical
  615
+  if a:filename != ''
  616
+    if has_key(s:cached_filenames, a:filename)
  617
+      return s:cached_filenames[a:filename]
  618
+    endif
  619
+      let canonical = s:resolve(fnamemodify(a:filename, ':p'))
  620
+      let s:cached_filenames[a:filename] = canonical
  621
+      return canonical
  622
+    endif
616 623
   endif
  624
+  return ''
617 625
 endfunction
618 626
 
619 627
 let s:cached_filenames = {}

0 notes on commit f38bcf6

Please sign in to comment.
Something went wrong with that request. Please try again.