From a9176778795147b3c7f30a2d18424df224d7f29d Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Fri, 25 Apr 2014 22:33:13 +0200 Subject: [PATCH] Limit default rtp rearrangement Rearranging rtp so that **all** default directories appear first has the undesired side effect of not allowing plugins to override default syntax files. This changeset limits the rearrangement of the rtp to simply making sure the first directory in the default runtimepath appears first in also in the runtimepath after Vundle has finished manipulating it. This should keep the original bugs fixed and should eliminate the aforementioned undesired side effect. Fixes #430 Fixes #456 --- autoload/vundle/config.vim | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 46d694e..5ecb30b 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -166,15 +166,12 @@ func! s:rtp_add_defaults() set rtp&vim let default = &rtp let &rtp = current - for item in reverse(split(default, ',')) - let item = fnameescape(item) - exec 'set rtp-=' . item - if fnamemodify(item, ":t") == 'after' - exec 'set rtp+=' . item - else - exec 'set rtp^=' . item - endif - endfor + let default_rtp_items = split(default, ',') + if !empty(default_rtp_items) + let first_item = fnameescape(default_rtp_items[0]) + exec 'set rtp-=' . first_item + exec 'set rtp^=' . first_item + endif endf