From 0b70bb365ff941a74acd7a906a5c785d49d3cf66 Mon Sep 17 00:00:00 2001 From: Grzegorz Rozdzialik Date: Mon, 22 Mar 2021 22:11:22 +0100 Subject: [PATCH] Show refs in log in Gstatus Display refs (the output of %D from git log's format=pretty) next to commit summaries in Gstatus. Use basic syntax highlighting for all refs. Use digraphs to reduce the possibility of false positives when syntax highlighting. --- autoload/fugitive.vim | 6 +++--- syntax/fugitive.vim | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index b08c98d855..9ea5600b22 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1701,14 +1701,14 @@ function! s:ReplaceCmd(cmd) abort endfunction function! s:QueryLog(refspec) abort - let lines = s:LinesError(['log', '-n', '256', '--pretty=format:%h%x09%s', a:refspec, '--'])[0] + let lines = s:LinesError(['log', '-n', '256', '--pretty=format:%h%x09%s%x09%D', a:refspec, '--'])[0] call map(lines, 'split(v:val, "\t")') - call map(lines, '{"type": "Log", "commit": v:val[0], "subject": v:val[-1]}') + call map(lines, '{"type": "Log", "commit": v:val[0], "subject": v:val[1], "ref": get(v:val, 2, "")}') return lines endfunction function! s:FormatLog(dict) abort - return a:dict.commit . ' ' . a:dict.subject + return a:dict.commit . ' ' . a:dict.subject .. ((len(a:dict.ref) > 0) ? (' «' . a:dict.ref . '»') : '') endfunction function! s:FormatRebase(dict) abort diff --git a/syntax/fugitive.vim b/syntax/fugitive.vim index e84eba4e76..39a9fe479e 100644 --- a/syntax/fugitive.vim +++ b/syntax/fugitive.vim @@ -25,6 +25,7 @@ syn match fugitiveModifier /^[MADRCU?]\{1,2} / contained containedin=@fugitiveSe syn match fugitiveSymbolicRef /\.\@!\%(\.\.\@!\|[^[:space:][:cntrl:]\:.]\)\+\.\@