[fzf#vim#colors] Remove duplicate colorschemes (#278)

Use s:uniq() instead of uniq() for older versions of Vim.

We don't sort the list before passing it to s:uniq() because
1. s:uniq() can process unsorted lists.
2. And in that way, we can list color schemes from plugins before
   the default ones provided by Vim.
This commit is contained in:
Matthew Klein 2016-12-24 10:27:53 -06:00 committed by Junegunn Choi
parent 7460b4382c
commit 2066643243

View file

@ -358,8 +358,8 @@ endfunction
" ------------------------------------------------------------------
function! fzf#vim#colors(...)
return s:fzf('colors', {
\ 'source': map(split(globpath(&rtp, "colors/*.vim"), "\n"),
\ "substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')"),
\ 'source': s:uniq(map(split(globpath(&rtp, "colors/*.vim"), "\n"),
\ "substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')")),
\ 'sink': 'colo',
\ 'options': '+m --prompt="Colors> "'
\}, a:000)