macOS: Syntax highlighter: Swift can bridge c strings automatically

This commit is contained in:
Roopesh Chander 2019-03-22 15:31:02 +05:30
parent 7754f81dca
commit ae4a728428
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ class ConfTextStorage: NSTextStorage {
.font: defaultFont .font: defaultFont
] ]
backingStore.setAttributes(defaultAttributes, range: fullTextRange) backingStore.setAttributes(defaultAttributes, range: fullTextRange)
var spans = highlight_config(backingStore.string.cString(using: String.Encoding.utf8))! var spans = highlight_config(backingStore.string)!
evaluateExcludePrivateIPs(highlightSpans: spans) evaluateExcludePrivateIPs(highlightSpans: spans)
while spans.pointee.type != HighlightEnd { while spans.pointee.type != HighlightEnd {