From fa61881d9c19fb487b263e4580cc1742e93b37ee Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Fri, 8 Jan 2016 14:51:04 -0800 Subject: [PATCH] Everything contains everything! This can't possibly be true. But right now somethings haven't been highlighted correctly because the wrapper types have been blocking them. Now these are explicitly marked as containing ALL, which works in the example.swift file. I'm sure we're going to have to back this off, and we'll do that case by case. --- example/example.swift | 5 +++++ syntax/swift.vim | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/example/example.swift b/example/example.swift index 4793d5e..7a37f0b 100644 --- a/example/example.swift +++ b/example/example.swift @@ -309,3 +309,8 @@ public let fareEstimate: FareEstimate //= (nil, nil) // comment should be highli key = map.optionalFrom("string") ?? [] key = map.optionalFrom("string") thing = map.optionalFrom("string") ?? .Fallback + +guard let path = NSBundle.mainBundle().pathForResource(imageName, ofType: "png"), + let data = NSData(contentsOfFile: path) else +{ +} diff --git a/syntax/swift.vim b/syntax/swift.vim index 787c5c8..5405a0d 100644 --- a/syntax/swift.vim +++ b/syntax/swift.vim @@ -199,9 +199,9 @@ syntax keyword swiftStructure \ struct \ enum -syntax region swiftTypeWrapper start="\v:\s*" skip="\s*,\s*$*\s*" end="$\|/"me=e-1 contains=swiftString,swiftBoolean,swiftNumber,swiftType,swiftGenericsWrapper transparent +syntax region swiftTypeWrapper start="\v:\s*" skip="\s*,\s*$*\s*" end="$\|/"me=e-1 contains=ALL transparent syntax region swiftGenericsWrapper start="\v\<" end="\v\>" contains=swiftType transparent oneline -syntax region swiftLiteralWrapper start="\v\=\s*" skip="\v[^\[\]]\(\)" end="\v(\[\]|\(\))" contains=swiftType,swiftString,swiftMethod,swiftOperator transparent oneline +syntax region swiftLiteralWrapper start="\v\=\s*" skip="\v[^\[\]]\(\)" end="\v(\[\]|\(\))" contains=ALL transparent oneline syntax region swiftReturnWrapper start="\v-\>\s*" end="\v(\{|$)" contains=swiftType transparent oneline syntax match swiftType "\v<\u\w*" contained containedin=swiftGenericsWrapper,swiftTypeWrapper,swiftLiteralWrapper,swiftGenericsWrapper