File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 2121
2222- Fix issue with slice of pointer type not highlighting user-defined types
2323 correctly
24+ - Fix issue where identifiers after case statements in switch statements nested
25+ inside type switch statements were highlighted as types
2426
2527## Version 0.1.0 - 2022/12/26
2628
Original file line number Diff line number Diff line change @@ -642,7 +642,10 @@ syntax keyword goSelect select contained
642642syntax keyword goSwitchKeywords case fallthrough default contained
643643
644644syntax match goSwitchTypeCase / ^\s\+ case\s / contained skipwhite nextgroup =@goType
645- syntax region goSwitchTypeBlock matchgroup =goSwitchTypeBraces start =' {' end =' }' contained contains =goSwitchTypeCase,@goStatement
645+ syntax region goSwitchTypeBlock matchgroup =goSwitchTypeBraces start =' {' end =' }' contained contains =goSwitchTypeCase,goSwitchTypeBlockNestedBraces,@goStatement
646+
647+ " goSwitchTypeBlockNestedBraces prevents goSwitchTypeCase from matching "case" in a regular nested switch statement
648+ syntax region goSwitchTypeBlockNestedBraces matchgroup =goBraces start =' {' end =' }' contained contains =@goStatement
646649
647650hi link goIf Conditional
648651hi link goElse goIf
@@ -666,9 +669,10 @@ syntax keyword goKeywords defer go contained
666669
667670" goTypeAssertion is a part of the nextgroup list of goDotExpr
668671syntax region goTypeAssertion matchgroup =goParens start =/ (/ end =/ )/ contained contains =@goType
669- syntax match goTypeAssertion / (type)/ contained contains =goParenBlock,goTypeDecl skipwhite nextgroup =goSwitchTypeBlock
672+ syntax match goTypeAssertion / (type)/ contained contains =goParenBlock skipwhite nextgroup =goSwitchTypeBlock
670673
671- hi link goKeywords Keyword
674+ hi link goKeywords Keyword
675+ hi link goTypeAssertion Special
672676
673677" }}} Misc
674678
You can’t perform that action at this time.
0 commit comments