File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -838,6 +838,9 @@ function! s:Options(args) abort
838
838
\ ' tries' : g: startuptime_tries ,
839
839
\ }
840
840
let l: idx = 0
841
+ " WARN: Any new/removed/changed arguments below should have corresponding
842
+ " updates below in the startuptime#CompleteOptions function and the
843
+ " startuptime#StartupTime usage documentation.
841
844
while l: idx <# len (a: args )
842
845
let l: arg = a: args [l: idx ]
843
846
if l: arg == # ' --help'
@@ -870,6 +873,21 @@ function! s:Options(args) abort
870
873
return l: options
871
874
endfunction
872
875
876
+ " A 'custom' completion function for :StartupTime. A 'custom' function is used
877
+ " instead of a 'customlist' function, for the automatic filtering that is
878
+ " conducted for the former, but not the latter.
879
+ function ! startuptime#CompleteOptions (... ) abort
880
+ let l: args = [
881
+ \ ' --help' ,
882
+ \ ' --other-events' , ' --no-other-events' ,
883
+ \ ' --self' , ' --no-self' ,
884
+ \ ' --sort' , ' --no-sort' ,
885
+ \ ' --sourcing-events' , ' --no-sourcing-events' ,
886
+ \ ' --tries' ,
887
+ \ ]
888
+ return join (l: args , " \n " )
889
+ endfunction
890
+
873
891
" Usage:
874
892
" :StartupTime
875
893
" \ [--sort] [--no-sort]
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ let s:save_cpo = &cpo
7
7
set cpo &vim
8
8
9
9
if ! exists (' :StartupTime' )
10
- command -nargs =* StartupTime
10
+ command -nargs =* - complete = custom ,startuptime#CompleteOptions StartupTime
11
11
\ :call startuptime#StartupTime (<q-mods> , <f-args> )
12
12
endif
13
13
You can’t perform that action at this time.
0 commit comments