From 10ed70a9c23cdd1748444e89e4928282e510451d Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 31 May 2021 19:35:26 -0400 Subject: [PATCH] Don't call exists() on invalid function name References: https://github.com/tpope/vim-fugitive/issues/1751 --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 26f1637..516610f 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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('')