Skip to content

Commit 766c56f

Browse files
committed
vim: highlight more delimiters appropriately
1 parent 51a2df7 commit 766c56f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

utils/vim/syntax/swift.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,18 @@ syn match swiftType contained nextgroup=swiftTypeParameters
111111
\ /\<[A-Za-z_][A-Za-z_0-9\.]*\>[!?]\?/
112112
" [Type:Type] (dictionary) or [Type] (array)
113113
syn region swiftType contained contains=swiftTypePair,swiftType
114-
\ start=/\[/ end=/\]/
114+
\ matchgroup=Delimiter start=/\[/ end=/\]/
115115
syn match swiftTypePair contained nextgroup=swiftTypeParameters,swiftTypeDeclaration
116116
\ /\<[A-Za-z_][A-Za-z_0-9\.]*\>[!?]\?/
117117
" (Type[, Type]) (tuple)
118+
" FIXME: we should be able to use skip="," and drop swiftParamDelim
118119
syn region swiftType contained contains=swiftType,swiftParamDelim
119-
\ start="[^@](" end=")"
120+
\ matchgroup=Delimiter start="[^@](" end=")" matchgroup=NONE skip=","
120121
syn match swiftParamDelim contained
121122
\ /,/
122123
" <Generic Clause> (generics)
123124
syn region swiftTypeParameters contained contains=swiftVarName,swiftConstraint
124-
\ start="<" end=">"
125+
\ matchgroup=Delimiter start="<" end=">" matchgroup=NONE skip=","
125126
syn keyword swiftConstraint contained
126127
\ where
127128

0 commit comments

Comments
 (0)