@@ -109,15 +109,13 @@ GoDeferCleanup delcom GoFoldStruct
109109
110110" Two top-level clusters to allow regions to specify what syntax they can
111111" contain
112- syntax cluster goExpr contains =@goLiteral,goDotExpr,goFuncLiteral,goCommaExpr,goOperator,goWordStart,goParenBlock,goBracketBlock,goComment
112+ syntax cluster goExpr contains =@goLiteral,goForRange, goDotExpr,goFuncLiteral,goCommaExpr,goOperator,goWordStart,goParenBlock,goBracketBlock,goComment
113113syntax cluster goStatement contains =@goExpr,@goFlowControl,goReturn,goSemicolon,goBraceBlock,goStatementStart,goConstDecl,goVarDecl,goTypeDecl,goKeywords
114114
115- syntax match goIdentifier / \K\k */ contained nextgroup =goDotExpr skipwhite
116-
117115" 'goWordStart' reduces the number of times each of the 'nextgroups' is checked,
118116" but also prevents 'goImportedPackages' (a keyword syntax element) from
119117" overriding matches (e.g. in 'goStructLiteralField').
120- syntax match goWordStart / \<\z e\K / contained nextgroup =goStructLiteral,goFuncCall,goBuiltins,goMakeBuiltin,goNewBuiltin,goImportedPackages,goIdentifier
118+ syntax match goWordStart / \<\z e\K / contained nextgroup =goStructLiteral,goFuncCall,goBuiltins,goMakeBuiltin,goNewBuiltin,goImportedPackages
121119
122120" 'goDotExpr' matches a dot that is found as a part of an expression, whereas
123121" 'goDot' is used to highlight a dot in non-expression contexts (e.g. the dot
@@ -636,7 +634,7 @@ call s:HiConfig('goFuncCallParens', ['go_highlight_function_call_parens'])
636634
637635" Flow Control {{{
638636
639- syntax cluster goFlowControl contains =goIf,goElse,goFor,goForKeywords,goSwitch,goSelect,goSwitchKeywords
637+ syntax cluster goFlowControl contains =goIf,goElse,goFor,goForRange, goForKeywords,goSwitch,goCase ,goSelect,goSwitchKeywords
640638
641639" 'goStatementStart' is used to avoid searching for 'goLabel' everywhere
642640syntax match goLabel / \K\k *\z e:/ contained
@@ -645,11 +643,13 @@ syntax keyword goIf if contained skipwhite skipempty nextgroup=
645643syntax keyword goElse else contained
646644
647645syntax keyword goFor for contained skipwhite skipempty nextgroup =goShortVarDecl
648- syntax keyword goForKeywords range break continue contained
646+ syntax keyword goForRange range contained
647+ syntax keyword goForKeywords break continue contained
649648
650649syntax keyword goSwitch switch contained skipwhite nextgroup =goShortVarDecl
651650syntax keyword goSelect select contained
652- syntax keyword goSwitchKeywords case fallthrough default contained
651+ syntax keyword goCase case contained skipwhite nextgroup =goShortVarDecl
652+ syntax keyword goSwitchKeywords fallthrough default contained
653653
654654syntax match goSwitchTypeCase / ^\s\+ case\s / contained skipwhite nextgroup =@goType
655655syntax region goSwitchTypeBlock matchgroup =goSwitchTypeBraces start =' {' end =' }' contained contains =goSwitchTypeCase,goSwitchTypeBlockNestedBraces,@goStatement
@@ -661,10 +661,12 @@ hi link goIf Conditional
661661hi link goElse goIf
662662
663663hi link goFor Repeat
664+ hi link goForRange goFor
664665hi link goForKeywords goFor
665666
666667hi link goSwitch Conditional
667668hi link goSelect goSwitch
669+ hi link goCase goSwitch
668670hi link goSwitchKeywords goSwitch
669671
670672hi link goSwitchTypeBraces goBraces
0 commit comments