Skip to content

Commit 347b3f6

Browse files
committed
Use correct mode names when g:ctrlp_types is customised.
Instead of just filtering s:coretypes (which contains descriptive mode names) based on g:ctrlp_types, change the order of its elements so the correct mode name is fetched. Fixes #309.
1 parent ec0ec24 commit 347b3f6

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

autoload/ctrlp.vim

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,13 @@ el
212212
en
213213
let g:ctrlp_builtins = len(g:ctrlp_types)-1
214214

215-
let s:coretypes = filter([
216-
\ ['files', 'fil'],
217-
\ ['buffers', 'buf'],
218-
\ ['mru files', 'mru'],
219-
\ ], 'index(g:ctrlp_types, v:val[1])!=-1')
215+
let s:coretype_names = {
216+
\ 'fil' : 'files',
217+
\ 'buf' : 'buffers',
218+
\ 'mru' : 'mru files',
219+
\ }
220+
221+
let s:coretypes = map(copy(g:ctrlp_types), '[s:coretype_names[v:val], v:val]')
220222

221223
" Get the options {{{2
222224
fu! s:opts(...)

0 commit comments

Comments
 (0)