Fix vim72 test failed (again)

Add s:uniq() and use it
This commit is contained in:
h_east 2018-07-01 00:29:20 +09:00
parent 2a1fd8281a
commit 6014409b59

View File

@ -601,7 +601,7 @@ function! s:update(force, names)
endfunction endfunction
function! s:is_exec_helptags(docdir) 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 for ext in exts
let tagname = 'tags' . (ext == 'txt' ? '' : '-' . ext[:1]) let tagname = 'tags' . (ext == 'txt' ? '' : '-' . ext[:1])
if !filereadable(a:docdir .'/'. tagname) || empty(s:system('cd ' . s:shellesc(a:docdir) . ' && git ls-files ' . tagname)) 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'] return [err, err =~# 'PlugClean']
endfunction 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) function! s:rm_rf(dir)
if isdirectory(a:dir) if isdirectory(a:dir)
call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(a:dir)) call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(a:dir))