mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-19 18:47:29 -07:00
Fix vim72 test failed (again)
Add s:uniq() and use it
This commit is contained in:
parent
2a1fd8281a
commit
6014409b59
19
plug.vim
19
plug.vim
@ -601,7 +601,7 @@ function! s:update(force, names)
|
||||
endfunction
|
||||
|
||||
function! s:is_exec_helptags(docdir)
|
||||
let exts = uniq(sort(map(s:glob(a:docdir, '*.{txt,??x}'), 'v:val[-3:]')))
|
||||
let exts = s:uniq(sort(map(s:glob(a:docdir, '*.{txt,??x}'), 'v:val[-3:]')))
|
||||
for ext in exts
|
||||
let tagname = 'tags' . (ext == 'txt' ? '' : '-' . ext[:1])
|
||||
if !filereadable(a:docdir .'/'. tagname) || empty(s:system('cd ' . s:shellesc(a:docdir) . ' && git ls-files ' . tagname))
|
||||
@ -2111,6 +2111,23 @@ function! s:git_validate(spec, check_branch)
|
||||
return [err, err =~# 'PlugClean']
|
||||
endfunction
|
||||
|
||||
if exists('*uniq')
|
||||
function! s:uniq(list) abort
|
||||
return uniq(a:list)
|
||||
endfunction
|
||||
else
|
||||
function! s:uniq(list) abort
|
||||
let i = len(a:list) - 1
|
||||
while 0 < i
|
||||
if a:list[i] ==# a:list[i - 1]
|
||||
call remove(a:list, i)
|
||||
endif
|
||||
let i -= 1
|
||||
endwhile
|
||||
return a:list
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function! s:rm_rf(dir)
|
||||
if isdirectory(a:dir)
|
||||
call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(a:dir))
|
||||
|
Loading…
Reference in New Issue
Block a user