mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-11 12:53:52 -05:00
Don't call exists() on invalid function name
References: https://github.com/tpope/vim-fugitive/issues/1751
This commit is contained in:
@@ -2861,7 +2861,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
||||
let name = substitute(get(args, 0, ''), '\%(^\|-\)\(\l\)', '\u\1', 'g')
|
||||
let git = s:UserCommandList()
|
||||
let options = {'git': git, 'dir': dir, 'flags': flags}
|
||||
if pager is# -1 && exists('*s:' . name . 'Subcommand') && get(args, 1, '') !=# '--help'
|
||||
if pager is# -1 && name =~# '^\a\+$' && exists('*s:' . name . 'Subcommand') && get(args, 1, '') !=# '--help'
|
||||
try
|
||||
let overrides = s:{name}Subcommand(a:line1, a:line2, a:range, a:bang, a:mods, extend({'subcommand': args[0], 'subcommand_args': args[1:-1]}, options))
|
||||
if type(overrides) == type('')
|
||||
|
||||
Reference in New Issue
Block a user