From 31629d8bd18ddb5db6d9c55585d1eeb325a6bb43 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 22 Feb 2020 22:12:26 -0500 Subject: [PATCH] Use :read for :{range}Git! --paginate --- autoload/fugitive.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 4f749d1..6cd722b 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2460,8 +2460,8 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort if args[0] =~# '^-p$\|^--paginate$' call remove(args, 0) let pager = 1 - if a:bang && a:line2 == 0 - let editcmd .= '!' + if a:bang && a:line2 >= 0 + let editcmd = 'read' elseif a:bang let editcmd = 'pedit' endif @@ -2469,7 +2469,11 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort let pager = fugitive#PagerFor(args, config) endif if a:bang || pager is# 1 - return s:OpenExec(editcmd, a:mods, env, args, options) . after + if editcmd ==# 'read' + return s:ReadExec(a:line1, a:line2, a:range, a:mods, env, args, options) . after + else + return s:OpenExec(editcmd, a:mods, env, args, options) . after + endif endif if s:HasOpt(args, ['add', 'checkout', 'commit', 'stage', 'stash', 'reset'], '-p', '--patch') || \ s:HasOpt(args, ['add', 'clean', 'stage'], '-i', '--interactive') ||