Skip to content
This repository
Browse code

Moved &tags option parsing to autoload script

The autoload/xolox/option.vim script isn't included in this repository
because I call the autoload/xolox/*.vim scripts from several of my
plug-ins. If I were to include these dependencies in each plug-in
repository I would find myself copy/pasting bug fixes between
repositories and I don't want that. However the Makefile packages up all
required autoload scripts into the ZIP archives published on
www.vim.org.
  • Loading branch information...
commit 1c8733ee23d792bf5f7c325f6e5babec14f798f2 1 parent 3f762e2
Peter Odding authored June 10, 2010

Showing 1 changed file with 4 additions and 9 deletions. Show diff stats Hide diff stats

  1. 13  easytags.vim
13  easytags.vim
@@ -77,20 +77,15 @@ unlet s:ctags_installed
77 77
 
78 78
 " Parse the &tags option and get a list of all configured tags files including
79 79
 " non-existing files (this is why we can't just call the tagfiles() function).
80  
-let s:tagfiles = []
81  
-let s:expanded = []
82  
-for s:entry in split(&tags, '[^\\]\zs,')
83  
-  call add(s:tagfiles, s:entry)
84  
-  call add(s:expanded, expand(substitute(s:entry, '\\\([\\, ]\)', '\1', 'g')))
85  
-endfor
  80
+let s:tagfiles = xolox#option#split_tags(&tags)
  81
+let s:expanded = map(copy(s:tagfiles), 'expand(v:val)')
86 82
 
87 83
 " Add the tags file to the &tags option when the user hasn't done so already.
88 84
 if index(s:expanded, expand(g:easytags_file)) == -1
89  
-  let s:entry = substitute(expand(g:easytags_file), '[, ]', '\\\0', 'g')
90  
-  let &tags = join(insert(s:tagfiles, s:entry, 0), ',')
  85
+  let &tags = xolox#option#join_tags(insert(s:tagfiles, g:easytags_file, 0))
91 86
 endif
92 87
 
93  
-unlet s:tagfiles s:expanded s:entry
  88
+unlet s:tagfiles s:expanded
94 89
 
95 90
 " The :UpdateTags and :HighlightTags commands. {{{1
96 91
 

0 notes on commit 1c8733e

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