mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 05:43:52 -05:00
Try harder to match diff headers with ambiguous spacing
Resolves: https://github.com/tpope/vim-fugitive/issues/2135
This commit is contained in:
@@ -7639,7 +7639,10 @@ function! s:NavigateUp(count) abort
|
||||
endfunction
|
||||
|
||||
function! s:ParseDiffHeader(str) abort
|
||||
let list = matchlist(a:str, '\Cdiff --git \("\=[^/].*\|/dev/null\) \("\=[^/].*\|/dev/null\)$')
|
||||
let list = matchlist(a:str, '\Cdiff --git \("\=\w/.*\|/dev/null\) \("\=\w/.*\|/dev/null\)$')
|
||||
if empty(list)
|
||||
let list = matchlist(a:str, '\Cdiff --git \("\=[^/].*\|/dev/null\) \("\=[^/].*\|/dev/null\)$')
|
||||
endif
|
||||
return [fugitive#Unquote(get(list, 1, '')), fugitive#Unquote(get(list, 2, ''))]
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user