commit edae34e02fdc487bbdd1a43fcb89aac99d59495c (tree)
parent d7172882b758ef58e2e8e2000541bb38d88d3707
Author: Tim Pope <code@tpope.net>
Date: Wed, 7 Aug 2019 00:52:38 -0400
Fix count with jump to commit section
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -2256,9 +2256,9 @@ function! s:StageJump(offset, section, ...) abort
exe line
if a:offset
for i in range(a:offset)
- call search(s:file_pattern . '\|^$')
+ call search(s:file_commit_pattern . '\|^$', 'W')
if empty(getline('.')) && a:0 && getline(line('.') + 1) =~# '^\%(' . a:1 . '\)'
- call search(s:file_pattern . '\|^$')
+ call search(s:file_commit_pattern . '\|^$', 'W')
endif
if empty(getline('.'))
return ''
@@ -2280,7 +2280,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'], 'Untracked': ['Unstaged', 'Stacked']}, info.section, [])
+ for section in get({'Staged': ['Unstaged', 'Untracked'], 'Unstaged': ['Untracked', 'Staged'], 'Untracked': ['Unstaged', 'Staged']}, info.section, [])
let line = search('^' . section, 'wn')
if line
return line + (info.index > 0 ? 1 : 0)
@@ -2673,7 +2673,8 @@ function! s:StageReveal(...) abort
endfunction
let s:file_pattern = '^[A-Z?] .\|^diff --'
-let s:item_pattern = s:file_pattern . '\|^\%(\l\{3,\} \)\=[0-9a-f]\{4,\} \|^@@'
+let s:file_commit_pattern = s:file_pattern . '\|^\%(\l\{3,\} \)\=[0-9a-f]\{4,\} '
+let s:item_pattern = s:file_commit_pattern . '\|^@@'
function! s:NextHunk(count) abort
if &filetype ==# 'fugitive' && getline('.') =~# s:file_pattern