From 349e5afc4f7df59a08ed2fff3c04b130f30bdedc Mon Sep 17 00:00:00 2001 From: Kien N Date: Sun, 8 Apr 2012 12:08:01 +0700 Subject: [PATCH] Generalize getting extension vars --- autoload/ctrlp.vim | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index 53ad5bd..3aa9c55 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -818,8 +818,7 @@ fu! s:AcceptSelection(mode) en if empty(line) | retu | en " Do something with it - let actfunc = s:itemtype < 3 ? 'ctrlp#acceptfile' - \ : g:ctrlp_ext_vars[s:itemtype - 3]['accept'] + let actfunc = s:itemtype < 3 ? 'ctrlp#acceptfile' : s:getextvar('accept') cal call(actfunc, [a:mode, line]) endf " - CreateNewFile() {{{1 @@ -1115,8 +1114,7 @@ fu! s:lash(...) endf fu! s:ispathitem() - retu s:itemtype < 3 || - \ ( s:itemtype > 2 && g:ctrlp_ext_vars[s:itemtype - 3]['type'] == 'path' ) + retu s:itemtype < 3 || ( s:itemtype > 2 && s:getextvar('type') == 'path' ) endf fu! ctrlp#dirnfile(entries) @@ -1586,8 +1584,7 @@ fu! s:insertcache(str) endf " Extensions {{{2 fu! s:mtype() - retu s:itemtype > 2 - \ ? g:ctrlp_ext_vars[s:itemtype - 3]['type'] : 'path' + retu s:itemtype > 2 ? s:getextvar('type') : 'path' endf fu! s:execextvar(key)