fix NSFontTraitMask member names
This commit is contained in:
parent
7261678cb9
commit
94b0965be2
|
|
@ -225,8 +225,8 @@ private func highlightMarkdownLine(_ trimmed: String, lineRange: NSRange, textSt
|
|||
private func highlightCodeLine(_ line: String, lineRange: NSRange, textStorage: NSTextStorage, syn: Theme.SyntaxColors) {
|
||||
let nsLine = line as NSString
|
||||
let baseFont = Theme.editorFont
|
||||
let italicFont = NSFontManager.shared.convert(baseFont, toHaveTrait: .italicTrait)
|
||||
let boldFont = NSFontManager.shared.convert(baseFont, toHaveTrait: .boldTrait)
|
||||
let italicFont = NSFontManager.shared.convert(baseFont, toHaveTrait: .italicFontMask)
|
||||
let boldFont = NSFontManager.shared.convert(baseFont, toHaveTrait: .boldFontMask)
|
||||
|
||||
let trimmed = line.trimmingCharacters(in: .whitespaces)
|
||||
|
||||
|
|
@ -252,10 +252,10 @@ private func highlightCodeLine(_ line: String, lineRange: NSRange, textStorage:
|
|||
highlightCodeTokens(nsLine, inRange: NSRange(location: 0, length: nsLine.length), lineOffset: lineRange.location, textStorage: textStorage, syn: syn)
|
||||
|
||||
// Bold markers **text**
|
||||
highlightInlineMarkdown(textStorage: textStorage, lineRange: lineRange, pattern: "\\*\\*(.+?)\\*\\*", markerLen: 2, trait: .boldTrait, font: boldFont)
|
||||
highlightInlineMarkdown(textStorage: textStorage, lineRange: lineRange, pattern: "\\*\\*(.+?)\\*\\*", markerLen: 2, trait: .boldFontMask, font: boldFont)
|
||||
|
||||
// Italic markers *text*
|
||||
highlightInlineMarkdown(textStorage: textStorage, lineRange: lineRange, pattern: "(?<!\\*)\\*(?!\\*)(.+?)(?<!\\*)\\*(?!\\*)", markerLen: 1, trait: .italicTrait, font: italicFont)
|
||||
highlightInlineMarkdown(textStorage: textStorage, lineRange: lineRange, pattern: "(?<!\\*)\\*(?!\\*)(.+?)(?<!\\*)\\*(?!\\*)", markerLen: 1, trait: .italicFontMask, font: italicFont)
|
||||
}
|
||||
|
||||
private func highlightInlineMarkdown(textStorage: NSTextStorage, lineRange: NSRange, pattern: String, markerLen: Int, trait: NSFontTraitMask, font: NSFont) {
|
||||
|
|
@ -359,7 +359,7 @@ private func highlightCodeTokens(_ line: NSString, inRange range: NSRange, lineO
|
|||
private func highlightBlockComments(textStorage: NSTextStorage, syn: Theme.SyntaxColors, baseFont: NSFont) {
|
||||
let text = textStorage.string
|
||||
let nsText = text as NSString
|
||||
let italicFont = NSFontManager.shared.convert(baseFont, toHaveTrait: .italicTrait)
|
||||
let italicFont = NSFontManager.shared.convert(baseFont, toHaveTrait: .italicFontMask)
|
||||
|
||||
guard let regex = try? NSRegularExpression(pattern: "/\\*.*?\\*/", options: .dotMatchesLineSeparators) else { return }
|
||||
let fullRange = NSRange(location: 0, length: nsText.length)
|
||||
|
|
|
|||
Loading…
Reference in New Issue