From b1c3cdffc94c2cbe48777db5cf8bc9156b17d070 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 29 Dec 2021 16:48:37 -0500 Subject: [PATCH] Fix status reload after staging entire section Resolves: https://github.com/tpope/vim-fugitive/issues/1912 --- autoload/fugitive.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 40b12bd..3971b8c 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -5139,11 +5139,14 @@ function! s:StagePatch(lnum1,lnum2) abort for lnum in range(a:lnum1,a:lnum2) let info = s:StageInfo(lnum) if empty(info.paths) && info.section ==# 'Staged' - return 'tab Git reset --patch' + execute 'tab Git reset --patch' + break elseif empty(info.paths) && info.section ==# 'Unstaged' - return 'tab Git add --patch' + execute 'tab Git add --patch' + break elseif empty(info.paths) && info.section ==# 'Untracked' - return 'tab Git add --interactive' + execute 'tab Git add --interactive' + break elseif empty(info.paths) continue endif