Use lower case for subcommand declarations
This commit is contained in:
parent
3ca888470b
commit
b4d40abb10
@ -583,9 +583,8 @@ endfunction
|
|||||||
|
|
||||||
function! s:Command(command, line1, line2, range, bang, mods, arg, args) abort
|
function! s:Command(command, line1, line2, range, bang, mods, arg, args) abort
|
||||||
try
|
try
|
||||||
if exists('*s:' . a:command . 'Subcommand')
|
if a:command =~# '^\l[[:alnum:]-]\+$'
|
||||||
let hyphenated = tolower(substitute(a:command, '\l\zs\u', '-\1', 'g'))
|
return s:GitCommand(a:line1, a:line2, a:range, a:line2, a:bang, s:Mods(a:mods), '', a:command . ' ' . a:arg, [a:command] + a:args)
|
||||||
return s:GitCommand(a:line1, a:line2, a:range, a:line2, a:bang, s:Mods(a:mods), '', hyphenated . ' ' . a:arg, [hyphenated] + a:args)
|
|
||||||
endif
|
endif
|
||||||
return s:{a:command}Command(a:line1, a:line2, a:range, a:line2, a:bang, s:Mods(a:mods), '', a:arg, a:args)
|
return s:{a:command}Command(a:line1, a:line2, a:range, a:line2, a:bang, s:Mods(a:mods), '', a:arg, a:args)
|
||||||
catch /^fugitive:/
|
catch /^fugitive:/
|
||||||
@ -3376,8 +3375,8 @@ function! s:FinishCommit() abort
|
|||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call s:command("-nargs=? -complete=customlist,s:CommitComplete Gcommit", "Commit")
|
call s:command("-nargs=? -complete=customlist,s:CommitComplete Gcommit", "commit")
|
||||||
call s:command("-nargs=? -complete=customlist,s:RevertComplete Grevert", "Revert")
|
call s:command("-nargs=? -complete=customlist,s:RevertComplete Grevert", "revert")
|
||||||
|
|
||||||
" Section: :Gmerge, :Grebase, :Gpull
|
" Section: :Gmerge, :Grebase, :Gpull
|
||||||
|
|
||||||
@ -3656,9 +3655,9 @@ augroup fugitive_merge
|
|||||||
\ endif
|
\ endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
call s:command("-nargs=? -bang -complete=customlist,s:MergeComplete Gmerge", "Merge")
|
call s:command("-nargs=? -bang -complete=customlist,s:MergeComplete Gmerge", "merge")
|
||||||
call s:command("-nargs=? -bang -complete=customlist,s:RebaseComplete Grebase", "Rebase")
|
call s:command("-nargs=? -bang -complete=customlist,s:RebaseComplete Grebase", "rebase")
|
||||||
call s:command("-nargs=? -bang -complete=customlist,s:PullComplete Gpull", "Pull")
|
call s:command("-nargs=? -bang -complete=customlist,s:PullComplete Gpull", "pull")
|
||||||
|
|
||||||
" Section: :Ggrep, :Glog
|
" Section: :Ggrep, :Glog
|
||||||
|
|
||||||
@ -4254,8 +4253,8 @@ function! s:FetchSubcommand(line1, line2, range, bang, mods, args) abort
|
|||||||
return s:Dispatch(a:bang ? '!' : '', 'fetch', a:args)
|
return s:Dispatch(a:bang ? '!' : '', 'fetch', a:args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call s:command("-nargs=? -bang -complete=customlist,s:PushComplete Gpush", "Push")
|
call s:command("-nargs=? -bang -complete=customlist,s:PushComplete Gpush", "push")
|
||||||
call s:command("-nargs=? -bang -complete=customlist,s:FetchComplete Gfetch", "Fetch")
|
call s:command("-nargs=? -bang -complete=customlist,s:FetchComplete Gfetch", "fetch")
|
||||||
|
|
||||||
" Section: :Gdiff
|
" Section: :Gdiff
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user