From 7e91b47021fadef7432856b34167f56569f2ac3f Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 7 Jul 2019 13:59:44 -0400 Subject: [PATCH] Move blame syntax to separate file --- autoload/fugitive.vim | 4 +--- syntax/fugitiveblame.vim | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 syntax/fugitiveblame.vim diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index c4b05ac..661f68e 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -3982,7 +3982,6 @@ endfunction augroup fugitive_blame autocmd! autocmd FileType fugitiveblame setlocal nomodeline | if len(s:Dir()) | let &l:keywordprg = s:Keywordprg() | endif - autocmd Syntax fugitiveblame call s:BlameSyntax() autocmd User Fugitive \ if get(b:, 'fugitive_type') =~# '^\%(file\|blob\|blame\)$' || filereadable(@%) | \ exe "command! -buffer -bar -bang -range=0 -nargs=* Gblame :execute s:BlameCommand(,,+'',,0,'',,,[])" | @@ -4206,8 +4205,7 @@ endfunction let s:hash_colors = {} -function! s:BlameSyntax() abort - let b:current_syntax = 'fugitiveblame' +function! fugitive#BlameSyntax() abort let conceal = has('conceal') ? ' conceal' : '' syn match FugitiveblameBoundary "^\^" syn match FugitiveblameBlank "^\s\+\s\@=" nextgroup=FugitiveblameAnnotation,fugitiveblameOriginalFile,FugitiveblameOriginalLineNumber skipwhite diff --git a/syntax/fugitiveblame.vim b/syntax/fugitiveblame.vim new file mode 100644 index 0000000..c06d19e --- /dev/null +++ b/syntax/fugitiveblame.vim @@ -0,0 +1,7 @@ +if exists("b:current_syntax") + finish +endif + +call fugitive#BlameSyntax() + +let b:current_syntax = "fugitiveblame"