mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 22:33:51 -05:00
Improve horizontal scrolling performance of :Git blame
References: https://github.com/tpope/vim-sensible/pull/124
This commit is contained in:
@@ -7156,6 +7156,9 @@ function! fugitive#BlameSyntax() abort
|
||||
return
|
||||
endif
|
||||
let seen = {}
|
||||
for x in split('01234567890abcdef', '\zs')
|
||||
exe 'syn match FugitiveblameHashGroup'.x '"\%(^\^\=[*?]*\)\@<='.x.'\x\{5,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameOriginalLineNumber,fugitiveblameOriginalFile skipwhite'
|
||||
endfor
|
||||
for lnum in range(1, line('$'))
|
||||
let orig_hash = matchstr(getline(lnum), '^\^\=[*?]*\zs\x\{6\}')
|
||||
let hash = orig_hash
|
||||
@@ -7177,8 +7180,8 @@ function! fugitive#BlameSyntax() abort
|
||||
else
|
||||
let s:hash_colors[hash] = ''
|
||||
endif
|
||||
let pattern = substitute(orig_hash, '^\(\x\)\x\(\x\)\x\(\x\)\x$', '\1\\x\2\\x\3\\x', '') . '*\>'
|
||||
exe 'syn match FugitiveblameHash'.hash.' "\%(^\^\=[*?]*\)\@<='.pattern.'" nextgroup=FugitiveblameAnnotation,FugitiveblameOriginalLineNumber,fugitiveblameOriginalFile skipwhite'
|
||||
let pattern = substitute(orig_hash, '^\(\x\)\x\(\x\)\x\(\x\)\x$', '\1\\x\2\\x\3\\x', '') . '*'
|
||||
exe 'syn match FugitiveblameHash'.hash.' "\%(^\^\=[*?]*\)\@<='.pattern.'" contained containedin=FugitiveblameHashGroup' . orig_hash[0]
|
||||
endfor
|
||||
syn match FugitiveblameUncommitted "\%(^\^\=[?*]*\)\@<=\<0\{7,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalLineNumber,FugitiveblameOriginalFile skipwhite
|
||||
call s:BlameRehighlight()
|
||||
|
||||
Reference in New Issue
Block a user