From cb112cbcb96036f424da432b776988bc5eef7077 Mon Sep 17 00:00:00 2001 From: mattn Date: Thu, 22 Aug 2013 13:19:56 +0900 Subject: [PATCH] Don't use name 'vim-airline' to check loadable extensions. Someone may git clone as another directory. --- autoload/airline/extensions.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 26a8c05..016dd46 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -10,6 +10,8 @@ function! s:ext.add_cursormove_funcref(funcref) dict call add(self._cursormove_funcrefs, a:funcref) endfunction +let s:script_path = expand(':p:h') + let s:filetype_overrides = { \ 'netrw': [ 'netrw', '%f' ], \ 'unite': [ 'Unite', '%{unite#get_status_string()}' ], @@ -183,7 +185,7 @@ function! airline#extensions#load() " load all other extensions not part of the default distribution for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), '\n') - if match(fnamemodify(file, ':p'), '\vvim-airline(/|\\)autoload') < 0 + if stridx(fnamemodify(file, ':p'), s:script_path) < 0 let name = fnamemodify(file, ':t:r') if !get(g:, 'airline#extensions#'.name.'#enabled', 1) continue