From 2066643243eddf2ed1f5d3a1a5485d6ff71851a4 Mon Sep 17 00:00:00 2001 From: Matthew Klein Date: Sat, 24 Dec 2016 10:27:53 -0600 Subject: [PATCH] [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. --- autoload/fzf/vim.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index dd0b024..0c259c3 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -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)