diff options
author | Peter Odding <peter@peterodding.com> | 2010-06-06 12:33:15 +0200 |
---|---|---|
committer | Peter Odding <peter@peterodding.com> | 2010-06-06 12:33:15 +0200 |
commit | 8d13bd28ed9c5bfeef4ac09c2981821e1cf0fdc1 (patch) | |
tree | 4e6f494df547eebe4d836e059da5b301b15a130d /autoload.vim | |
parent | 58ccaa03ce3c224bdd0df943ddfd02cda70b5baf (diff) | |
download | vim-easytags-8d13bd28ed9c5bfeef4ac09c2981821e1cf0fdc1.tar.gz |
Moved script-local function s:unique() to autoload script
On the one hand I don't want to force people to download half my Vim profile
before they can try one of the plug-ins I've written, but on the other hand I
don't want to keep copy/pasting miscellaneous functions all over the place...
Diffstat (limited to 'autoload.vim')
-rw-r--r-- | autoload.vim | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/autoload.vim b/autoload.vim index 5900b85..600135a 100644 --- a/autoload.vim +++ b/autoload.vim @@ -95,7 +95,7 @@ function! easytags#highlight_cmd() " {{{1 endif let matches = filter(copy(taglist), tagkind.filter) call map(matches, 'xolox#escape#pattern(get(v:val, "name"))') - let pattern = tagkind.pattern_prefix . '\%(' . join(s:unique(matches), '\|') . '\)' . tagkind.pattern_suffix + let pattern = tagkind.pattern_prefix . '\%(' . join(xolox#unique(matches), '\|') . '\)' . tagkind.pattern_suffix let command = 'syntax match %s /%s/ containedin=ALLBUT,.*String.*,.*Comment.*' execute printf(command, hlgroup_tagged, escape(pattern, '/')) endfor @@ -104,21 +104,6 @@ function! easytags#highlight_cmd() " {{{1 endif endfunction -function! s:unique(list) - let index = 0 - while index < len(a:list) - let value = a:list[index] - let match = index(a:list, value, index+1) - if match >= 0 - call remove(a:list, match) - else - let index += 1 - endif - unlet value - endwhile - return a:list -endfunction - function! easytags#get_tagsfile() " {{{1 let tagsfile = expand(g:easytags_file) if filereadable(tagsfile) && filewritable(tagsfile) != 1 |