From 0ab2d9709cf4b96f5338a38322211ff6162efd84 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 1 Aug 2019 19:27:35 -0400 Subject: [PATCH] Preserve cursor position after staging last untracked file --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 19145fe..c3459c8 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2244,7 +2244,7 @@ function! s:StageSeek(info, fallback) abort endif let line = search('^' . info.section, 'wn') if !line - for section in get({'Staged': ['Unstaged', 'Untracked'], 'Unstaged': ['Untracked', 'Staged']}, info.section, []) + for section in get({'Staged': ['Unstaged', 'Untracked'], 'Unstaged': ['Untracked', 'Staged'], 'Untracked': ['Unstaged', 'Stacked']}, info.section, []) let line = search('^' . section, 'wn') if line return line + (info.index > 0 ? 1 : 0)