Skip to content

Commit

Permalink
Test implementation of key/val packing.
Browse files Browse the repository at this point in the history
  • Loading branch information
starcraftman committed Mar 23, 2014
1 parent bf70a15 commit b5e07f7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/vundle.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

" Plugin Commands
com! -nargs=+ -bar Plugin
\ call vundle#config#bundle(<args>)
\ call vundle#config#plugin(<args>)

com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginInstall
\ call vundle#installer#new('!' == '<bang>', <q-args>)
Expand Down
29 changes: 29 additions & 0 deletions autoload/vundle/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ func! vundle#config#bundle(arg, ...)
return bundle
endf

func! vundle#config#plugin(arg, ...)
" If arguments aren't passed in as dict, pack them
if a:0 > 0 && type(a:1) != type({})
let opts = s:pack_dict(a:000)
else
let opts = a:000
endif

let bundle = vundle#config#init_bundle(a:arg, opts)
call add(g:bundles, bundle)
return bundle
endf

func! vundle#config#init()
if !exists('g:bundles') | let g:bundles = [] | endif
call s:rtp_rm_a()
Expand Down Expand Up @@ -33,6 +46,22 @@ func! vundle#config#init_bundle(name, opts)
return b
endf

func! s:pack_dict(...)
let dict = {}
let n_list = []

for ele in a:000
let words = split(ele, '=')
if len(words) > 1
let dict[words[0]] = words[1]
else
let n_list = insert(n_list, ele)
endif
endfor

return insert(n_list, dict)
endf

func! s:parse_options(opts)
" TODO: improve this
if len(a:opts) != 1 | return {} | endif
Expand Down

0 comments on commit b5e07f7

Please sign in to comment.