From b0a47a6e97e7a78934d938c156dc7fc92d5e5ce3 Mon Sep 17 00:00:00 2001 From: Bertrand Sim Date: Thu, 29 Jul 2021 16:37:13 +0800 Subject: [PATCH 1/4] highlight adjacent tags, branch names differently when tags and branch names are shown next to each other, they are _both_ highlighted with gvTag, or with gvMeta eg (tag: 0.0.0.9000, origin/master, origin/HEAD, master) eg (origin/master, origin/HEAD, master, tag: 0.0.0.9000) This commit fixes that: tags are highlighted with gvTag, while branch names are highlighted with gvMeta --- plugin/gv.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/gv.vim b/plugin/gv.vim index b59a12d..1942a11 100644 --- a/plugin/gv.vim +++ b/plugin/gv.vim @@ -134,7 +134,8 @@ function! s:syntax() syn match gvMessage /.* \ze(.\{-})$/ contained contains=gvTag,gvGitHub,gvJira nextgroup=gvAuthor syn match gvAuthor /.*$/ contained syn match gvMeta /([^)]\+) / contained contains=gvTag nextgroup=gvMessage - syn match gvTag /(tag:[^)]\+)/ contained + " syn match gvTag /(tag:[^)]\+)/ contained + syn match gvTag /\((\|, \)tag: .\{-1,}\(, \|)\)/ contained syn match gvGitHub /\<#[0-9]\+\>/ contained syn match gvJira /\<[A-Z]\+-[0-9]\+\>/ contained hi def link gvDate Number From 98816e3bed73f184f16b0fdc129b862c7ea827fe Mon Sep 17 00:00:00 2001 From: Bertrand Sim Date: Thu, 29 Jul 2021 16:56:25 +0800 Subject: [PATCH 2/4] same highlights for ( and ) in gvMeta highlight opening ( and ) with gvMeta hl group eg in (tag: 0.0.0.9000, origin/master, origin/HEAD, master) the ( is highlighted with gvTag, but ) is highlighted with gvMeta this commit highlights both ( and ) with gvMeta --- plugin/gv.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/gv.vim b/plugin/gv.vim index 1942a11..7c68163 100644 --- a/plugin/gv.vim +++ b/plugin/gv.vim @@ -135,7 +135,8 @@ function! s:syntax() syn match gvAuthor /.*$/ contained syn match gvMeta /([^)]\+) / contained contains=gvTag nextgroup=gvMessage " syn match gvTag /(tag:[^)]\+)/ contained - syn match gvTag /\((\|, \)tag: .\{-1,}\(, \|)\)/ contained + " syn match gvTag /\((\|, \)tag: .\{-1,}\(, \|)\)/ contained + syn match gvTag /\((\|, \)\@<=tag: .\{-1,}\(, \|)\)\@=/ contained syn match gvGitHub /\<#[0-9]\+\>/ contained syn match gvJira /\<[A-Z]\+-[0-9]\+\>/ contained hi def link gvDate Number From 3a9a616a5e1fad92a07409259ce1711776485430 Mon Sep 17 00:00:00 2001 From: Bertrand Sim Date: Thu, 29 Jul 2021 17:07:13 +0800 Subject: [PATCH 3/4] highlight ( and ) in lone tags with gvTag In the previous commit, lone tags such as (tag: feature) have '(' and ')' highlighted with gvMeta, while 'tag: feature' is highlighted with gvTag. This looks odd. Thus, the case of a single lone tag should be defined separately: the '(' and ')' are included in the match, and are highlighted with gvTag. --- plugin/gv.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/gv.vim b/plugin/gv.vim index 7c68163..e17e34e 100644 --- a/plugin/gv.vim +++ b/plugin/gv.vim @@ -137,6 +137,7 @@ function! s:syntax() " syn match gvTag /(tag:[^)]\+)/ contained " syn match gvTag /\((\|, \)tag: .\{-1,}\(, \|)\)/ contained syn match gvTag /\((\|, \)\@<=tag: .\{-1,}\(, \|)\)\@=/ contained + syn match gvTag /(tag: [^ )]\+)/ contained syn match gvGitHub /\<#[0-9]\+\>/ contained syn match gvJira /\<[A-Z]\+-[0-9]\+\>/ contained hi def link gvDate Number From 4f9e7eec179bebe8a5b585ebf902133466120b7c Mon Sep 17 00:00:00 2001 From: Bertrand Sim Date: Thu, 29 Jul 2021 17:15:33 +0800 Subject: [PATCH 4/4] minor clean up comments --- plugin/gv.vim | 1 - 1 file changed, 1 deletion(-) diff --git a/plugin/gv.vim b/plugin/gv.vim index e17e34e..6f11023 100644 --- a/plugin/gv.vim +++ b/plugin/gv.vim @@ -135,7 +135,6 @@ function! s:syntax() syn match gvAuthor /.*$/ contained syn match gvMeta /([^)]\+) / contained contains=gvTag nextgroup=gvMessage " syn match gvTag /(tag:[^)]\+)/ contained - " syn match gvTag /\((\|, \)tag: .\{-1,}\(, \|)\)/ contained syn match gvTag /\((\|, \)\@<=tag: .\{-1,}\(, \|)\)\@=/ contained syn match gvTag /(tag: [^ )]\+)/ contained syn match gvGitHub /\<#[0-9]\+\>/ contained