mirror of
https://github.com/keith/swift.vim.git
synced 2025-12-22 12:14:13 +01:00
Allow nested strings in interpolated strings
Previously this broke all following syntax highlighting because it thought it was continuing a string
This commit is contained in:
@@ -309,6 +309,9 @@ key = map.optionalFrom("string") ?? []
|
||||
key = map.optionalFrom("string")
|
||||
thing = map.optionalFrom("string") ?? .Fallback
|
||||
|
||||
// This should not break all highlighting
|
||||
print("Copying \(NSProcessInfo().environment["SCRIPT_INPUT_FILE_\(index)"]!)")
|
||||
|
||||
guard let path = NSBundle.mainBundle().pathForResource(imageName, ofType: "png"),
|
||||
let data = NSData(contentsOfFile: path) else
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ delfunction s:CommentKeywordMatch
|
||||
" Literals
|
||||
" Strings
|
||||
syntax region swiftString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=swiftInterpolatedWrapper
|
||||
syntax region swiftInterpolatedWrapper start="\v[^\\]\\\(\s*" end="\v\s*\)" contained containedin=swiftString contains=swiftInterpolatedString
|
||||
syntax region swiftInterpolatedWrapper start="\v[^\\]\\\(\s*" end="\v\s*\)" contained containedin=swiftString contains=swiftInterpolatedString,swiftString
|
||||
syntax match swiftInterpolatedString "\v\w+(\(\))?" contained containedin=swiftInterpolatedWrapper
|
||||
|
||||
" Numbers
|
||||
|
||||
Reference in New Issue
Block a user