From 1e678795717daf71baf3f52aa1e76f1f05db77af Mon Sep 17 00:00:00 2001 From: Mitsuo Heijo Date: Sun, 7 Feb 2021 19:38:52 +0900 Subject: [PATCH] feat: support retract as keyword https://github.com/golang/go/blob/724d0720b3e110f64598bf789cbe2a6a1b3b0fd8/doc/go1.16.html#L155 https://github.com/golang/go/issues/24031 https://tip.golang.org/doc/go1.16#go-command https://github.com/golang/mod/commit/c0d644d00ab849f4506f17a98a5740bf0feff020 --- syntax/gomod.vim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/syntax/gomod.vim b/syntax/gomod.vim index 7dcef1a..2b158da 100644 --- a/syntax/gomod.vim +++ b/syntax/gomod.vim @@ -13,12 +13,14 @@ syntax keyword gomodGo go contained syntax keyword gomodRequire require syntax keyword gomodExclude exclude syntax keyword gomodReplace replace +syntax keyword gomodRetract retract " require, exclude, replace, and go can be also grouped into block -syntax region gomodRequire start='require (' end=')' transparent contains=gomodRequire,gomodVersion -syntax region gomodExclude start='exclude (' end=')' transparent contains=gomodExclude,gomodVersion -syntax region gomodReplace start='replace (' end=')' transparent contains=gomodReplace,gomodVersion -syntax match gomodGo '^go .*$' transparent contains=gomodGo,gomodGoVersion +syntax region gomodRequire start='require (' end=')' transparent contains=gomodRequire,gomodVersion +syntax region gomodExclude start='exclude (' end=')' transparent contains=gomodExclude,gomodVersion +syntax region gomodReplace start='replace (' end=')' transparent contains=gomodReplace,gomodVersion +syntax region gomodRetract start='retract \[' end='\]' transparent contains=gomodRetract,gomodVersion +syntax match gomodGo '^go .*$' transparent contains=gomodGo,gomodGoVersion " set highlights highlight default link gomodModule Keyword @@ -26,6 +28,7 @@ highlight default link gomodGo Keyword highlight default link gomodRequire Keyword highlight default link gomodExclude Keyword highlight default link gomodReplace Keyword +highlight default link gomodRetract Keyword " comments are always in form of // ... syntax region gomodComment start="//" end="$" contains=@Spell