From c5c1bd66d897501848312a97b408ca5255251a9a Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 25 Feb 2017 16:36:41 -0500 Subject: [PATCH] Ensure v:shell_error comes from correct command Closes https://github.com/tpope/vim-fugitive/issues/648 --- plugin/fugitive.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 1185ff1..67ae0be 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1060,13 +1060,14 @@ function! s:Commit(args, ...) abort else noautocmd silent execute '!'.command.' > '.outfile.' 2> '.errorfile endif + let shell_error = v:shell_error finally execute cd.'`=dir`' endtry if !has('gui_running') redraw! endif - if !v:shell_error + if !shell_error if filereadable(outfile) for line in readfile(outfile) echo line