Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'rts' plugin displays duplicates #107

Closed
datanoise opened this issue Jan 21, 2012 · 0 comments
Closed

'rts' plugin displays duplicates #107

datanoise opened this issue Jan 21, 2012 · 0 comments
Labels

Comments

@datanoise
Copy link

When you use pathogen, &rts contains your .vim directory as well as every directory under .vim/bundle, that's why there are duplicates. This patch fixes it:

diff --git a/autoload/ctrlp/rtscript.vim b/autoload/ctrlp/rtscript.vim
index 77a7a1f..2594966 100644
--- a/autoload/ctrlp/rtscript.vim
+++ b/autoload/ctrlp/rtscript.vim
@@ -27,6 +27,8 @@ fu! ctrlp#rtscript#init()
        if g:ctrlp_newrts || !exists('g:ctrlp_rtscache')
                sil! cal ctrlp#progress('Indexing...')
                let entries = split(globpath(&rtp, '**/*.\(vim\|txt\)'), "\n")
+               " remove dups
+               let entries = filter(copy(entries),'index(entries, v:val, v:key+1)==-1')
                let [g:ctrlp_rtscache, g:ctrlp_newrts] = [ctrlp#dirnfile(entries)[1], 0]
        en
        retu g:ctrlp_rtscache
@kien kien closed this as completed in e7b08a3 Jan 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants