Use :pedit for :Git! --paginate

This commit is contained in:
Tim Pope
2020-02-18 16:36:48 -05:00
parent efb1c8a29d
commit 8b83d6ec6c
2 changed files with 8 additions and 2 deletions

View File

@@ -2456,14 +2456,20 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
endif
let i += 1
endwhile
let editcmd = (a:line2 > 0 ? a:line2 : '') . (a:line2 ? 'split' : 'edit')
if args[0] =~# '^-p$\|^--paginate$'
call remove(args, 0)
let pager = 1
if a:bang && a:line2 == 0
let editcmd .= '!'
elseif a:bang
let editcmd = 'pedit'
endif
else
let pager = fugitive#PagerFor(args, config)
endif
if a:bang || pager is# 1
return s:OpenExec((a:line2 > 0 ? a:line2 : '') . (a:line2 ? 'split' : 'edit'), a:mods, env, flags + args, dir) . after
return s:OpenExec(editcmd, a:mods, env, flags + args, dir) . after
endif
if s:HasOpt(args, ['add', 'checkout', 'commit', 'stage', 'stash', 'reset'], '-p', '--patch') ||
\ s:HasOpt(args, ['add', 'clean', 'stage'], '-i', '--interactive') ||

View File

@@ -637,7 +637,7 @@ just one space character longer than the legacy version.
*:Gvsplit!* Superseded by |:vert| |:Git| --paginate.
*:Gtabsplit!* Superseded by |:tab| |:Git| --paginate.
*:Gedit!* Superseded by :0Git --paginate.
*:Gpedit!* Deprecated with no current plans for replacement.
*:Gpedit!* Superseded by :Git! --paginate.
ABOUT *fugitive-about*