mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 05:43:52 -05:00
Accommodate git-blame revision ignoring features
Closes https://github.com/tpope/vim-fugitive/issues/1316
This commit is contained in:
@@ -4670,7 +4670,7 @@ function! s:BlameCommitFileLnum(...) abort
|
|||||||
let commit = get(s:LinesError('rev-list', '--ancestry-path', '--reverse', commit . '..' . state.blame_reverse_end)[0], 0, '')
|
let commit = get(s:LinesError('rev-list', '--ancestry-path', '--reverse', commit . '..' . state.blame_reverse_end)[0], 0, '')
|
||||||
endif
|
endif
|
||||||
let lnum = +matchstr(line, ' \zs\d\+\ze \%((\| *\d\+)\)')
|
let lnum = +matchstr(line, ' \zs\d\+\ze \%((\| *\d\+)\)')
|
||||||
let path = matchstr(line, '^\^\=\x* \+\%(\d\+ \+\d\+ \+\)\=\zs.\{-\}\ze\s\+\%(\%( \d\+ \)\@<!([^()]*\w \d\+)\|\d\+ \)')
|
let path = matchstr(line, '^\^\=[?*]*\x* \+\%(\d\+ \+\d\+ \+\)\=\zs.\{-\}\ze\s\+\%(\%( \d\+ \)\@<!([^()]*\w \d\+)\|\d\+ \)')
|
||||||
if empty(path) && lnum
|
if empty(path) && lnum
|
||||||
let path = get(state, 'blame_file', '')
|
let path = get(state, 'blame_file', '')
|
||||||
endif
|
endif
|
||||||
@@ -4735,7 +4735,7 @@ function! s:BlameSubcommand(line1, count, range, bang, mods, args) abort
|
|||||||
elseif arg =~# '^-L.'
|
elseif arg =~# '^-L.'
|
||||||
call add(ranges, remove(flags, i))
|
call add(ranges, remove(flags, i))
|
||||||
continue
|
continue
|
||||||
elseif arg =~# '^-[GLS]$\|^--\%(date\|encoding\|contents\)$'
|
elseif arg =~# '^-[GLS]$\|^--\%(date\|encoding\|contents\|ignore-rev\|ignore-revs-file\)$'
|
||||||
let i += 1
|
let i += 1
|
||||||
if i == len(flags)
|
if i == len(flags)
|
||||||
echohl ErrorMsg
|
echohl ErrorMsg
|
||||||
@@ -5022,10 +5022,10 @@ function! fugitive#BlameSyntax() abort
|
|||||||
let config = fugitive#Config()
|
let config = fugitive#Config()
|
||||||
let flags = get(s:TempState(), 'blame_flags', [])
|
let flags = get(s:TempState(), 'blame_flags', [])
|
||||||
syn match FugitiveblameBlank "^\s\+\s\@=" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalFile,FugitiveblameOriginalLineNumber skipwhite
|
syn match FugitiveblameBlank "^\s\+\s\@=" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalFile,FugitiveblameOriginalLineNumber skipwhite
|
||||||
syn match FugitiveblameHash "\%(^\^\=\)\@<=\<\x\{7,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalLineNumber,FugitiveblameOriginalFile skipwhite
|
syn match FugitiveblameHash "\%(^\^\=[?*]*\)\@<=\<\x\{7,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalLineNumber,FugitiveblameOriginalFile skipwhite
|
||||||
syn match FugitiveblameUncommitted "\%(^\^\=\)\@<=\<0\{7,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalLineNumber,FugitiveblameOriginalFile skipwhite
|
syn match FugitiveblameUncommitted "\%(^\^\=\)\@<=\<0\{7,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalLineNumber,FugitiveblameOriginalFile skipwhite
|
||||||
if get(get(config, 'blame.blankboundary', ['x']), 0, 'x') =~# '^$\|^true$' || s:HasOpt(flags, '-b')
|
if get(get(config, 'blame.blankboundary', ['x']), 0, 'x') =~# '^$\|^true$' || s:HasOpt(flags, '-b')
|
||||||
syn match FugitiveblameBoundaryIgnore "^\^\x\{7,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalLineNumber,FugitiveblameOriginalFile skipwhite
|
syn match FugitiveblameBoundaryIgnore "^\^[*?]*\x\{7,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalLineNumber,FugitiveblameOriginalFile skipwhite
|
||||||
else
|
else
|
||||||
syn match FugitiveblameBoundary "^\^"
|
syn match FugitiveblameBoundary "^\^"
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user