Preserve cursor position after staging last untracked file
This commit is contained in:
parent
7df9f07e1f
commit
0ab2d9709c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user