mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 20:43:46 -05:00
Fix count with jump to commit section
This commit is contained in:
@@ -2256,9 +2256,9 @@ function! s:StageJump(offset, section, ...) abort
|
|||||||
exe line
|
exe line
|
||||||
if a:offset
|
if a:offset
|
||||||
for i in range(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 . '\)'
|
if empty(getline('.')) && a:0 && getline(line('.') + 1) =~# '^\%(' . a:1 . '\)'
|
||||||
call search(s:file_pattern . '\|^$')
|
call search(s:file_commit_pattern . '\|^$', 'W')
|
||||||
endif
|
endif
|
||||||
if empty(getline('.'))
|
if empty(getline('.'))
|
||||||
return ''
|
return ''
|
||||||
@@ -2280,7 +2280,7 @@ function! s:StageSeek(info, fallback) abort
|
|||||||
endif
|
endif
|
||||||
let line = search('^' . info.section, 'wn')
|
let line = search('^' . info.section, 'wn')
|
||||||
if !line
|
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')
|
let line = search('^' . section, 'wn')
|
||||||
if line
|
if line
|
||||||
return line + (info.index > 0 ? 1 : 0)
|
return line + (info.index > 0 ? 1 : 0)
|
||||||
@@ -2673,7 +2673,8 @@ function! s:StageReveal(...) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:file_pattern = '^[A-Z?] .\|^diff --'
|
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
|
function! s:NextHunk(count) abort
|
||||||
if &filetype ==# 'fugitive' && getline('.') =~# s:file_pattern
|
if &filetype ==# 'fugitive' && getline('.') =~# s:file_pattern
|
||||||
|
|||||||
Reference in New Issue
Block a user