From d725ef529e3de712304ab0f9c7e5e61107a00cad Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 1 Apr 2022 17:40:48 -0400 Subject: [PATCH] Turn remaining deprecated commands into error stubs --- plugin/fugitive.vim | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 6801f6f..a1fe60e 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -604,27 +604,40 @@ exe 'command! -bar -bang -nargs=0 GUnlink exe fugitive#UnlinkCommand(, , , +"", 0, "", )' exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject GMove exe fugitive#MoveCommand( , , +"", 0, "", )' exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete GRename exe fugitive#RenameCommand(, , +"", 0, "", )' -if exists(':Gremove') != 2 && get(g:, 'fugitive_legacy_commands', 1) +if exists(':Gremove') != 2 && get(g:, 'fugitive_legacy_commands', 0) exe 'command! -bar -bang -nargs=0 Gremove exe fugitive#RemoveCommand(, , +"", 0, "", )' \ '|echohl WarningMSG|echomsg ":Gremove is deprecated in favor of :GRemove"|echohl NONE' +elseif exists(':Gremove') != 2 && !exists('g:fugitive_legacy_commands') + exe 'command! -bar -bang -nargs=0 Gremove echoerr ":Gremove has been removed in favor of :GRemove"' endif -if exists(':Gdelete') != 2 && get(g:, 'fugitive_legacy_commands', 1) +if exists(':Gdelete') != 2 && get(g:, 'fugitive_legacy_commands', 0) exe 'command! -bar -bang -nargs=0 Gdelete exe fugitive#DeleteCommand(, , +"", 0, "", )' \ '|echohl WarningMSG|echomsg ":Gdelete is deprecated in favor of :GDelete"|echohl NONE' +elseif exists(':Gdelete') != 2 && !exists('g:fugitive_legacy_commands') + exe 'command! -bar -bang -nargs=0 Gdelete echoerr ":Gremove has been removed in favor of :GRemove"' endif -if exists(':Gmove') != 2 && get(g:, 'fugitive_legacy_commands', 1) +if exists(':Gmove') != 2 && get(g:, 'fugitive_legacy_commands', 0) exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject Gmove exe fugitive#MoveCommand( , , +"", 0, "", )' \ '|echohl WarningMSG|echomsg ":Gmove is deprecated in favor of :GMove"|echohl NONE' +elseif exists(':Gmove') != 2 && !exists('g:fugitive_legacy_commands') + exe 'command! -bar -bang -nargs=? -complete=customlist,fugitive#CompleteObject Gmove' + \ 'echoerr ":Gmove has been removed in favor of :GMove"' endif -if exists(':Grename') != 2 && get(g:, 'fugitive_legacy_commands', 1) +if exists(':Grename') != 2 && get(g:, 'fugitive_legacy_commands', 0) exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete Grename exe fugitive#RenameCommand(, , +"", 0, "", )' \ '|echohl WarningMSG|echomsg ":Grename is deprecated in favor of :GRename"|echohl NONE' +elseif exists(':Grename') != 2 && !exists('g:fugitive_legacy_commands') + exe 'command! -bar -bang -nargs=? -complete=customlist,fugitive#RenameComplete Grename' + \ 'echoerr ":Grename has been removed in favor of :GRename"' endif exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject GBrowse exe fugitive#BrowseCommand(, , +"", 0, "", )' -if exists(':Gbrowse') != 2 && get(g:, 'fugitive_legacy_commands', 1) +if exists(':Gbrowse') != 2 && get(g:, 'fugitive_legacy_commands', 0) exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject Gbrowse exe fugitive#BrowseCommand(, , +"", 0, "", )' \ '|if 1|redraw!|endif|echohl WarningMSG|echomsg ":Gbrowse is deprecated in favor of :GBrowse"|echohl NONE' +elseif exists(':Gbrowse') != 2 && !exists('g:fugitive_legacy_commands') + exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject Gbrowse' + \ 'echoerr ":Gbrowse has been removed in favor of :GBrowse"' endif if v:version < 703