[Helptags] Fall back to s:uniq if uniq does not exist

Close #201
This commit is contained in:
Junegunn Choi
2016-09-22 11:01:42 +09:00
parent 0eb22e189d
commit 687f5e298f

View File

@@ -812,7 +812,8 @@ function! s:helptag_sink(line)
endfunction endfunction
function! fzf#vim#helptags(...) function! fzf#vim#helptags(...)
let tags = uniq(sort(split(globpath(&runtimepath, '**/doc/tags'), '\n'))) let sorted = sort(split(globpath(&runtimepath, '**/doc/tags'), '\n'))
let tags = exists('*uniq') ? uniq(sorted) : s:uniq(sorted)
return s:fzf('helptags', { return s:fzf('helptags', {
\ 'source': "grep -H '.*' ".join(map(tags, 'shellescape(v:val)')). \ 'source': "grep -H '.*' ".join(map(tags, 'shellescape(v:val)')).