Skip to content

Commit

Permalink
Add cmdline completion for all the autoloaded providers
Browse files Browse the repository at this point in the history
Close #429
  • Loading branch information
liuchengxu committed May 8, 2020
1 parent 14e003f commit d8ff7dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ CHANGELOG

## [unreleased]

### Improved

- Add cmdline completion for all the autoloaded providers. [#429](https://github.com/liuchengxu/vim-clap/issues/429)

## [0.15] 2020-05-02

### Added
Expand Down
5 changes: 4 additions & 1 deletion autoload/clap/helper.vim
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ function! clap#helper#complete(ArgLead, CmdLine, P) abort
endif
let registered = exists('g:clap') ? keys(g:clap.registrar) : []
let registered += ['install-binary', 'install-binary!', 'debug', 'debug+']
return filter(uniq(sort(g:clap#builtin_providers + keys(g:clap#provider_alias) + registered)), 'v:val =~# "^".a:ArgLead')
if !exists('s:autoload_providers')
let s:autoload_providers = map(split(globpath(&runtimepath, 'autoload/clap/provider/*.vim'), "\n"), 'fnamemodify(v:val, ":t:r")')
endif
return filter(uniq(sort(s:autoload_providers + keys(g:clap#provider_alias) + registered)), 'v:val =~# "^".a:ArgLead')
endfunction

function! clap#helper#echo_info(msg) abort
Expand Down

0 comments on commit d8ff7dc

Please sign in to comment.