Skip to content

Commit f9c26fc

Browse files
committed
Do not load too many syntax rules
1 parent c1db9ee commit f9c26fc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

plugin/git.vim

+2-3
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ function! s:DoHighlightGitBlame()
218218
for l in range(1, line('$'))
219219
let line = getline(l)
220220
let [commit, author] = matchlist(line, '\(\x\+\) (\(.\{-}\)\s* \d\d\d\d-\d\d-\d\d')[1:2]
221-
let syntax_name = s:LoadSyntaxRuleFor({ 'author': author })
222-
execute 'syntax match' syntax_name '+\%' . l . 'l.*+'
221+
call s:LoadSyntaxRuleFor({ 'author': author })
223222
endfor
224223
endfunction
225224

@@ -240,8 +239,8 @@ function! s:LoadSyntaxRuleFor(params)
240239
endif
241240
execute 'highlight' name printf('ctermfg=%d ctermbg=%d', n1, n2)
242241
endif
242+
execute 'syntax match' name '"\V\^\x\+ (' . escape(author, '\') . '\.\*"'
243243
endif
244-
return name
245244
endfunction
246245

247246
function! GitDoCommand(args)

0 commit comments

Comments
 (0)