Skip to content

Commit 91ec0e3

Browse files
committed
vim: remove duplicate swiftFuncName
This was duplicating the swiftTypeName. However, the swiftTypeName is more generically named and applies to both types and functions both in structure and usage. Retain the single definition.
1 parent 9a326fa commit 91ec0e3

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

utils/vim/syntax/swift.vim

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ syn keyword swiftScope
7777

7878
syn keyword swiftMutating skipwhite nextgroup=swiftFuncDefinition
7979
\ mutating
80-
syn keyword swiftFuncDefinition skipwhite nextgroup=swiftFuncName,swiftOperator
80+
syn keyword swiftFuncDefinition skipwhite nextgroup=swiftTypeName,swiftOperator
8181
\ func
8282

8383
syn keyword swiftTypeDefinition skipwhite nextgroup=swiftTypeName
@@ -94,6 +94,10 @@ syn keyword swiftVarDefinition skipwhite nextgroup=swiftVarName
9494

9595
syn match swiftTypeName contained nextgroup=swiftTypeParameters
9696
\ /\<[A-Za-z_][A-Za-z_0-9\.]*\>/
97+
syn match swiftVarName contained skipwhite nextgroup=swiftTypeDeclaration
98+
\ /\<[A-Za-z_][A-Za-z_0-9]*\>/
99+
syn match swiftImplicitVarName
100+
\ /\$\<[A-Za-z_0-9]\+\>/
97101

98102
" TypeName[Optionality]?
99103
syn match swiftType contained nextgroup=swiftTypeParameters
@@ -116,16 +120,10 @@ syn match swiftArchetype contained skipwhite nextgroup=swiftTypeDeclaration
116120
syn keyword swiftConstraint contained
117121
\ where
118122

119-
syn match swiftFuncName contained skipwhite nextgroup=swiftTypeParameters
120-
\ /\<[A-Za-z_][A-Za-z_0-9]*\>/
121-
122-
syn match swiftVarName contained
123-
\ /\<[A-Za-z_][A-Za-z_0-9]*\>/
124-
syn match swiftImplicitVarName
125-
\ /\$\<[A-Za-z_0-9]\+\>/
126-
127-
syn match swiftTypeDeclaration /:/ skipwhite nextgroup=swiftType
128-
syn match swiftTypeDeclaration /->/ skipwhite nextgroup=swiftType
123+
syn match swiftTypeDeclaration skipwhite nextgroup=swiftType
124+
\ /:/
125+
syn match swiftTypeDeclaration skipwhite nextgroup=swiftType
126+
\ /->/
129127

130128
syn keyword swiftBoolean true false
131129

@@ -173,7 +171,6 @@ hi def link swiftArchetype Identifier
173171
hi def link swiftConstraint Special
174172
hi def link swiftFuncDefinition Define
175173
hi def link swiftDefinitionModifier Define
176-
hi def link swiftFuncName Function
177174
hi def link swiftFuncKeyword Function
178175
hi def link swiftFuncKeywordGeneral Function
179176
hi def link swiftVarDefinition Define

0 commit comments

Comments
 (0)