Skip to content

Commit 80d7650

Browse files
authored
Merge pull request swiftlang#19764 from tokorom/vim-syntax-case-label-region
2 parents 52deae3 + ea2c860 commit 80d7650

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

utils/vim/syntax/swift.vim

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ endif
1010
syn keyword swiftKeyword
1111
\ associatedtype
1212
\ break
13-
\ case
1413
\ catch
1514
\ continue
16-
\ default
1715
\ defer
1816
\ do
1917
\ else
@@ -141,6 +139,13 @@ syn match swiftTypeDeclaration skipwhite skipempty nextgroup=swiftType,swiftInOu
141139
syn match swiftTypeDeclaration skipwhite skipempty nextgroup=swiftType
142140
\ /->/
143141

142+
syn match swiftKeyword
143+
\ /\<case\>/
144+
syn region swiftCaseLabelRegion
145+
\ matchgroup=swiftKeyword start=/\<case\>/ matchgroup=Delimiter end=/:/ oneline contains=TOP
146+
syn region swiftDefaultLabelRegion
147+
\ matchgroup=swiftKeyword start=/\<default\>/ matchgroup=Delimiter end=/:/
148+
144149
syn region swiftParenthesisRegion matchgroup=NONE start=/(/ end=/)/ contains=TOP
145150

146151
syn region swiftString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=swiftInterpolationRegion

0 commit comments

Comments
 (0)