From ed6b45a81a5be9b4620467ec404c87d107e093f1 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 7 Sep 2021 12:41:45 -0400 Subject: [PATCH] Drop unused args parameter from :Gcommand implementations We stopped using this in 6356bbc4a761757b3ed2886d6808da5c1f4b2d75. --- autoload/fugitive.vim | 18 ++++++++-------- plugin/fugitive.vim | 48 +++++++++++++++++++++---------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 9508228..ef302b6 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -5861,7 +5861,7 @@ function! s:BlurStatus() abort endfunction let s:bang_edits = {'split': 'Git', 'vsplit': 'vertical Git', 'tabedit': 'tab Git', 'pedit': 'Git!'} -function! fugitive#Open(cmd, bang, mods, arg, args) abort +function! fugitive#Open(cmd, bang, mods, arg, ...) abort exe s:VersionCheck() if a:bang return 'echoerr ' . string(':G' . a:cmd . '! for temp buffer output has been replaced by :' . get(s:bang_edits, a:cmd, 'Git') . ' --paginate') @@ -5901,7 +5901,7 @@ function! s:ReadPrepare(line1, count, range, mods) abort return [pre . 'keepalt ' . mods . after . 'read', '|' . delete . 'diffupdate' . (a:count < 0 ? '|' . line('.') : '')] endfunction -function! fugitive#ReadCommand(line1, count, range, bang, mods, arg, args) abort +function! fugitive#ReadCommand(line1, count, range, bang, mods, arg, ...) abort exe s:VersionCheck() if a:bang return 'echoerr ' . string(':Gread! for temp buffer output has been replaced by :{range}Git! --paginate') @@ -5936,7 +5936,7 @@ endfunction " Section: :Gwrite, :Gwq -function! fugitive#WriteCommand(line1, line2, range, bang, mods, arg, args) abort +function! fugitive#WriteCommand(line1, line2, range, bang, mods, arg, ...) abort exe s:VersionCheck() if s:cpath(expand('%:p'), fugitive#Find('.git/COMMIT_EDITMSG')) && empty(a:arg) return (empty($GIT_INDEX_FILE) ? 'write|bdelete' : 'wq') . (a:bang ? '!' : '') @@ -6213,7 +6213,7 @@ function! s:IsConflicted() abort return len(@%) && !empty(s:ChompDefault('', ['ls-files', '--unmerged', '--', expand('%:p')])) endfunction -function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort +function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, ...) abort exe s:VersionCheck() let args = s:ArgSplit(a:arg) let post = '' @@ -6424,11 +6424,11 @@ function! fugitive#RenameComplete(A,L,P) abort endif endfunction -function! fugitive#MoveCommand(line1, line2, range, bang, mods, arg, args) abort +function! fugitive#MoveCommand(line1, line2, range, bang, mods, arg, ...) abort return s:Move(a:bang, 0, a:arg) endfunction -function! fugitive#RenameCommand(line1, line2, range, bang, mods, arg, args) abort +function! fugitive#RenameCommand(line1, line2, range, bang, mods, arg, ...) abort return s:Move(a:bang, 1, a:arg) endfunction @@ -6454,11 +6454,11 @@ function! s:Remove(after, force) abort endif endfunction -function! fugitive#RemoveCommand(line1, line2, range, bang, mods, arg, args) abort +function! fugitive#RemoveCommand(line1, line2, range, bang, mods, arg, ...) abort return s:Remove('edit', a:bang) endfunction -function! fugitive#DeleteCommand(line1, line2, range, bang, mods, arg, args) abort +function! fugitive#DeleteCommand(line1, line2, range, bang, mods, arg, ...) abort return s:Remove('bdelete', a:bang) endfunction @@ -7030,7 +7030,7 @@ function! s:BrowserOpen(url, mods, echo_copy) abort endif endfunction -function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abort +function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abort exe s:VersionCheck() let dir = s:Dir() try diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index bcd48d2..e67e930 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -532,50 +532,50 @@ exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Gllog :exe fugitive#LogCommand(,,+"",0,"",, "l")' exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete GlLog :exe fugitive#LogCommand(,,+"",0,"",, "l")' -exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Ge exe fugitive#Open("edit", 0, "", , [])' -exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gedit exe fugitive#Open("edit", 0, "", , [])' -exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#ReadComplete Gpedit exe fugitive#Open("pedit", 0, "", , [])' -exe 'command! -bar -bang -nargs=* -range=-1' s:addr_other '-complete=customlist,fugitive#ReadComplete Gsplit exe fugitive#Open(( > 0 ? : "").( ? "split" : "edit"), 0, "", , [])' -exe 'command! -bar -bang -nargs=* -range=-1' s:addr_other '-complete=customlist,fugitive#ReadComplete Gvsplit exe fugitive#Open(( > 0 ? : "").( ? "vsplit" : "edit!"), 0, "", , [])' -exe 'command! -bar -bang -nargs=* -range=-1' s:addr_tabs '-complete=customlist,fugitive#ReadComplete Gtabedit exe fugitive#Open(( >= 0 ? : "")."tabedit", 0, "", , [])' +exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Ge exe fugitive#Open("edit", 0, "", )' +exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gedit exe fugitive#Open("edit", 0, "", )' +exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#ReadComplete Gpedit exe fugitive#Open("pedit", 0, "", )' +exe 'command! -bar -bang -nargs=* -range=-1' s:addr_other '-complete=customlist,fugitive#ReadComplete Gsplit exe fugitive#Open(( > 0 ? : "").( ? "split" : "edit"), 0, "", )' +exe 'command! -bar -bang -nargs=* -range=-1' s:addr_other '-complete=customlist,fugitive#ReadComplete Gvsplit exe fugitive#Open(( > 0 ? : "").( ? "vsplit" : "edit!"), 0, "", )' +exe 'command! -bar -bang -nargs=* -range=-1' s:addr_tabs '-complete=customlist,fugitive#ReadComplete Gtabedit exe fugitive#Open(( >= 0 ? : "")."tabedit", 0, "", )' if exists(':Gr') != 2 - exe 'command! -bar -bang -nargs=* -range=-1 -complete=customlist,fugitive#ReadComplete Gr exe fugitive#ReadCommand(, , +"", 0, "", , [])' + exe 'command! -bar -bang -nargs=* -range=-1 -complete=customlist,fugitive#ReadComplete Gr exe fugitive#ReadCommand(, , +"", 0, "", )' endif -exe 'command! -bar -bang -nargs=* -range=-1 -complete=customlist,fugitive#ReadComplete Gread exe fugitive#ReadCommand(, , +"", 0, "", , [])' +exe 'command! -bar -bang -nargs=* -range=-1 -complete=customlist,fugitive#ReadComplete Gread exe fugitive#ReadCommand(, , +"", 0, "", )' -exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gdiffsplit exe fugitive#Diffsplit(1, 0, "", , [])' -exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Ghdiffsplit exe fugitive#Diffsplit(0, 0, "", , [])' -exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gvdiffsplit exe fugitive#Diffsplit(0, 0, "vertical ", , [])' +exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gdiffsplit exe fugitive#Diffsplit(1, 0, "", )' +exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Ghdiffsplit exe fugitive#Diffsplit(0, 0, "", )' +exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gvdiffsplit exe fugitive#Diffsplit(0, 0, "vertical ", )' -exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gw exe fugitive#WriteCommand(, , +"", 0, "", , [])' -exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwrite exe fugitive#WriteCommand(, , +"", 0, "", , [])' -exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwq exe fugitive#WqCommand( , , +"", 0, "", , [])' +exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gw exe fugitive#WriteCommand(, , +"", 0, "", )' +exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwrite exe fugitive#WriteCommand(, , +"", 0, "", )' +exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwq exe fugitive#WqCommand( , , +"", 0, "", )' -exe 'command! -bar -bang -nargs=0 GRemove exe fugitive#RemoveCommand(, , +"", 0, "", , [])' -exe 'command! -bar -bang -nargs=0 GDelete exe fugitive#DeleteCommand(, , +"", 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, "", , [])' +exe 'command! -bar -bang -nargs=0 GRemove exe fugitive#RemoveCommand(, , +"", 0, "", )' +exe 'command! -bar -bang -nargs=0 GDelete exe fugitive#DeleteCommand(, , +"", 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) - exe 'command! -bar -bang -nargs=0 Gremove exe fugitive#RemoveCommand(, , +"", 0, "", , [])' + exe 'command! -bar -bang -nargs=0 Gremove exe fugitive#RemoveCommand(, , +"", 0, "", )' \ '|echohl WarningMSG|echomsg ":Gremove is deprecated in favor of :GRemove"|echohl NONE' endif if exists(':Gdelete') != 2 && get(g:, 'fugitive_legacy_commands', 1) - exe 'command! -bar -bang -nargs=0 Gdelete exe fugitive#DeleteCommand(, , +"", 0, "", , [])' + exe 'command! -bar -bang -nargs=0 Gdelete exe fugitive#DeleteCommand(, , +"", 0, "", )' \ '|echohl WarningMSG|echomsg ":Gdelete is deprecated in favor of :GDelete"|echohl NONE' endif if exists(':Gmove') != 2 && get(g:, 'fugitive_legacy_commands', 1) - exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject Gmove exe fugitive#MoveCommand( , , +"", 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' endif if exists(':Grename') != 2 && get(g:, 'fugitive_legacy_commands', 1) - exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete Grename exe fugitive#RenameCommand(, , +"", 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' endif -exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject GBrowse exe fugitive#BrowseCommand(, , +"", 0, "", , [])' +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) - exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject Gbrowse exe fugitive#BrowseCommand(, , +"", 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' endif