Skip to content

Commit f7779b4

Browse files
author
Akshay Hegde
committed
Ensure swiftTypeWrapper only wraps types in its own matchgroup
Enum members, numbers, other literals like string will be highlighted separately as part of their own matchgroup. The result is that this: fixes #93 fixes #90 fixes #89
1 parent 289ee2e commit f7779b4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

example/example.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,3 +360,12 @@ self.init(className: "Item", dictionary: [
360360
"summary": item.summary])
361361

362362
XCAssertEqual(variables as NSDictionary, expectedVariables as NSDictionary, "\(template)")
363+
364+
NSWorkspace.sharedWorkspace().notificationCenter.addObserver(
365+
self, selector: #selector(self.activeApplicationChanged(_:)),
366+
name: NSWorkspaceDidActivateApplicationNotification, object: nil
367+
)
368+
369+
public func find(closure: @noescape Element throws -> Bool) rethrows -> Element? {
370+
371+
}

syntax/swift.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ syntax keyword swiftDebugIdentifier
220220

221221
syntax keyword swiftLineDirective #setline
222222

223-
syntax region swiftTypeWrapper start="\v:\s*" skip="\s*,\s*$*\s*" end="$\|/"me=e-1 contains=ALLBUT,swiftInterpolatedWrapper transparent
223+
syntax region swiftTypeWrapper start=":\s*\(\.\)\@!\<\u" skip="\s*,\s*$*\s*" end="$\|/"me=e-1 contains=ALLBUT,swiftInterpolatedWrapper transparent
224224
syntax region swiftTypeCastWrapper start="\(as\|is\)\(!\|?\)\=\s\+" end="\v(\s|$|\{)" contains=swiftType,swiftCastKeyword keepend transparent oneline
225225
syntax region swiftGenericsWrapper start="\v\<" end="\v\>" contains=swiftType transparent oneline
226226
syntax region swiftLiteralWrapper start="\v\=\s*" skip="\v[^\[\]]\(\)" end="\v(\[\]|\(\))" contains=ALL transparent oneline

0 commit comments

Comments
 (0)