Support :Gwrite +aftercommand

Closes https://github.com/tpope/vim-fugitive/pull/562
This commit is contained in:
Tim Pope
2021-04-15 10:14:29 -04:00
parent f72ad60097
commit 4139dc521c

View File

@@ -5067,8 +5067,13 @@ function! fugitive#WriteCommand(line1, line2, range, bang, mods, arg, args) abor
endif endif
let mytab = tabpagenr() let mytab = tabpagenr()
let mybufnr = bufnr('') let mybufnr = bufnr('')
let args = s:ArgSplit(a:arg)
let after = ''
if get(args, 0) =~# '^+'
let after = '|' . remove(args, 0)[1:-1]
endif
try try
let file = len(a:arg) ? s:Generate(s:Expand(a:arg)) : fugitive#Real(@%) let file = len(args) ? s:Generate(s:Expand(join(args, ' '))) : fugitive#Real(@%)
catch /^fugitive:/ catch /^fugitive:/
return 'echoerr ' . string(v:exception) return 'echoerr ' . string(v:exception)
endtry endtry
@@ -5183,7 +5188,7 @@ function! fugitive#WriteCommand(line1, line2, range, bang, mods, arg, args) abor
endfor endfor
endfor endfor
call fugitive#ReloadStatus(-1, 1) call fugitive#ReloadStatus(-1, 1)
return 'checktime' return 'silent checktime' . after
endfunction endfunction
function! fugitive#WqCommand(...) abort function! fugitive#WqCommand(...) abort