From d818ac93af6f2f700690b0f84d13821036d7b831 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 22 Jul 2018 21:28:15 -0400 Subject: [PATCH] Make bang argument to :Glog explicit Playing with some changes here and committing this part makes it easier to reload the plugin after stashing changes. --- autoload/fugitive.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 36e6702..3aa4491 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1496,8 +1496,8 @@ endif call s:command("-bang -nargs=? -complete=customlist,s:EditComplete Ggrep :execute s:Grep('grep',0,)") call s:command("-bang -nargs=? -complete=customlist,s:EditComplete Glgrep :execute s:Grep('lgrep',0,)") -call s:command("-bar -bang -nargs=* -range=0 -complete=customlist,s:EditComplete Glog :call s:Log('grep',,,)") -call s:command("-bar -bang -nargs=* -range=0 -complete=customlist,s:EditComplete Gllog :call s:Log('lgrep',,,)") +call s:command("-bar -bang -nargs=* -range=0 -complete=customlist,s:EditComplete Glog :call s:Log('grep',0,,,)") +call s:command("-bar -bang -nargs=* -range=0 -complete=customlist,s:EditComplete Gllog :call s:Log('lgrep',0,,,)") function! s:Grep(cmd,bang,arg) abort let grepprg = &grepprg @@ -1538,7 +1538,7 @@ function! s:Grep(cmd,bang,arg) abort endtry endfunction -function! s:Log(cmd, line1, line2, ...) abort +function! s:Log(cmd, bang, line1, line2, ...) abort let path = s:Relative('/') if path =~# '^/\.git\%(/\|$\)' || index(a:000,'--') != -1 let path = '' @@ -1569,7 +1569,7 @@ function! s:Log(cmd, line1, line2, ...) abort execute cd s:fnameescape(s:repo().tree()) let &grepprg = escape(s:git_command() . join(map(cmd, '" ".s:shellesc(v:val)'), ''), '%#') let &grepformat = '%Cdiff %.%#,%C--- %.%#,%C+++ %.%#,%Z@@ -%\d%\+\,%\d%\+ +%l\,%\d%\+ @@,%-G-%.%#,%-G+%.%#,%-G %.%#,%A%f::%m,%-G%.%#' - exe a:cmd + exe a:cmd . (a:bang ? '!' : '') finally let &grepformat = grepformat let &grepprg = grepprg