Skip to content
This repository
Browse code

Bug fix: Canonicalize arguments to :UpdateTags!

  • Loading branch information...
commit 5efb2c7ee0d6926aaa0ad3080a53857ec910d4d3 1 parent 0d0fac6
Peter Odding authored September 06, 2010

Showing 2 changed files with 14 additions and 7 deletions. Show diff stats Hide diff stats

  1. 19  autoload.vim
  2. 2  easytags.vim
19  autoload.vim
@@ -38,6 +38,7 @@ endfunction
38 38
 
39 39
 function! easytags#update(silent, filter_tags, filenames) " {{{2
40 40
   try
  41
+    let s:cached_filenames = {}
41 42
     let starttime = xolox#timer#start()
42 43
     let cfile = s:check_cfile(a:silent, a:filter_tags, !empty(a:filenames))
43 44
     let tagsfile = easytags#get_tagsfile()
@@ -60,6 +61,8 @@ function! easytags#update(silent, filter_tags, filenames) " {{{2
60 61
     return 1
61 62
   catch
62 63
     call xolox#warning("%s: %s (at %s)", s:script, v:exception, v:throwpoint)
  64
+  finally
  65
+    unlet s:cached_filenames
63 66
   endtry
64 67
 endfunction
65 68
 
@@ -114,11 +117,17 @@ function! s:prep_cmdline(cfile, tagsfile, firstrun, arguments) " {{{3
114 117
     endif
115 118
     let have_args = 1
116 119
   else
117  
-    for fname in a:arguments
118  
-      let matches = split(expand(fname), "\n")
119  
-      if !empty(matches)
120  
-        call extend(cmdline, map(matches, 'shellescape(v:val)'))
  120
+    for arg in a:arguments
  121
+      if arg =~ '^-'
  122
+        call add(cmdline, arg)
121 123
         let have_args = 1
  124
+      else
  125
+        let matches = split(expand(arg), "\n")
  126
+        if !empty(matches)
  127
+          call map(matches, 'shellescape(s:canonicalize(v:val))')
  128
+          call extend(cmdline, matches)
  129
+          let have_args = 1
  130
+        endif
122 131
       endif
123 132
     endfor
124 133
   endif
@@ -156,7 +165,6 @@ function! s:filter_merge_tags(filter_tags, tagsfile, output) " {{{3
156 165
   let [headers, entries] = easytags#read_tagsfile(a:tagsfile)
157 166
   call s:set_tagged_files(entries)
158 167
   let filters = []
159  
-  let s:cached_filenames = {}
160 168
   let tagged_files = s:find_tagged_files(a:output)
161 169
   if !empty(tagged_files)
162 170
     call add(filters, '!has_key(tagged_files, s:canonicalize(get(v:val, 1)))')
@@ -168,7 +176,6 @@ function! s:filter_merge_tags(filter_tags, tagsfile, output) " {{{3
168 176
   if !empty(filters)
169 177
     call filter(entries, join(filters, ' && '))
170 178
   endif
171  
-  unlet s:cached_filenames
172 179
   let num_filtered = num_old_entries - len(entries)
173 180
   call map(entries, 'join(v:val, "\t")')
174 181
   call extend(entries, a:output)
2  easytags.vim
@@ -4,7 +4,7 @@
4 4
 " URL: http://peterodding.com/code/vim/easytags/
5 5
 " Requires: Exuberant Ctags (http://ctags.sf.net)
6 6
 " License: MIT
7  
-" Version: 2.1.6
  7
+" Version: 2.1.7
8 8
 
9 9
 " Support for automatic update using the GLVS plug-in.
10 10
 " GetLatestVimScripts: 3114 1 :AutoInstall: easytags.zip

0 notes on commit 5efb2c7

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