mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-12-10 14:02:01 +08: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
|
return
|
||||||
endif
|
endif
|
||||||
let seen = {}
|
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('$'))
|
for lnum in range(1, line('$'))
|
||||||
let orig_hash = matchstr(getline(lnum), '^\^\=[*?]*\zs\x\{6\}')
|
let orig_hash = matchstr(getline(lnum), '^\^\=[*?]*\zs\x\{6\}')
|
||||||
let hash = orig_hash
|
let hash = orig_hash
|
||||||
@@ -7177,8 +7180,8 @@ function! fugitive#BlameSyntax() abort
|
|||||||
else
|
else
|
||||||
let s:hash_colors[hash] = ''
|
let s:hash_colors[hash] = ''
|
||||||
endif
|
endif
|
||||||
let pattern = substitute(orig_hash, '^\(\x\)\x\(\x\)\x\(\x\)\x$', '\1\\x\2\\x\3\\x', '') . '*\>'
|
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'
|
exe 'syn match FugitiveblameHash'.hash.' "\%(^\^\=[*?]*\)\@<='.pattern.'" contained containedin=FugitiveblameHashGroup' . orig_hash[0]
|
||||||
endfor
|
endfor
|
||||||
syn match FugitiveblameUncommitted "\%(^\^\=[?*]*\)\@<=\<0\{7,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalLineNumber,FugitiveblameOriginalFile skipwhite
|
syn match FugitiveblameUncommitted "\%(^\^\=[?*]*\)\@<=\<0\{7,\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameScoreDebug,FugitiveblameOriginalLineNumber,FugitiveblameOriginalFile skipwhite
|
||||||
call s:BlameRehighlight()
|
call s:BlameRehighlight()
|
||||||
|
|||||||
Reference in New Issue
Block a user