diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index d7671f2..e579996 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -581,10 +581,18 @@ function! s:add_methods(namespace, method_names) abort endfor endfunction +function! s:Command(command, line1, line2, range, bang, mods, arg, args) abort + try + 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:/ + return 'echoerr ' . string(v:exception) + endtry +endfunction + let s:commands = [] function! s:command(definition, ...) abort if a:0 - call add(s:commands, a:definition . ' execute s:' . a:1 . "Command(, , +'', , 0, '', , , [])") + call add(s:commands, a:definition . ' execute s:Command(' . string(a:1) . ", , , +'', 0, '', , [])") else call add(s:commands, a:definition) endif