aboutsummaryrefslogtreecommitdiff
path: root/Map/Presentation/Base Components/MapTextEditor.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Map/Presentation/Base Components/MapTextEditor.swift')
-rw-r--r--Map/Presentation/Base Components/MapTextEditor.swift46
1 files changed, 24 insertions, 22 deletions
diff --git a/Map/Presentation/Base Components/MapTextEditor.swift b/Map/Presentation/Base Components/MapTextEditor.swift
index 3c5c824..18b2fbc 100644
--- a/Map/Presentation/Base Components/MapTextEditor.swift
+++ b/Map/Presentation/Base Components/MapTextEditor.swift
@@ -64,7 +64,7 @@ class MapTextEditorController: NSViewController {
scrollView.translatesAutoresizingMaskIntoConstraints = false
- textView.backgroundColor = .UI.background
+ textView.backgroundColor = .Theme.UI.background
textView.allowsUndo = true
textView.delegate = self
textView.textStorage?.delegate = self
@@ -92,7 +92,9 @@ class MapTextEditorController: NSViewController {
for (index, range) in highlightRanges.enumerated() {
let nsRange = NSRange(range, in: textStorage.string)
- let color = index == selectedRange ? NSColor.Syntax.highlightMatch : NSColor.Syntax.match
+ let color =
+ index == selectedRange
+ ? NSColor.Theme.Syntax.highlightMatch : NSColor.Theme.Syntax.match
textStorage.addAttribute(.backgroundColor, value: color, range: nsRange)
}
@@ -156,77 +158,77 @@ extension MapTextEditorController: NSTextStorageDelegate {
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Theme.Syntax.vertex], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Theme.Syntax.number], range: match.range(at: 2))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 3))
+ [.foregroundColor: NSColor.Theme.Syntax.number], range: match.range(at: 3))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 4))
+ [.foregroundColor: NSColor.Theme.Syntax.option], range: match.range(at: 4))
}
matches = edgeRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Theme.Syntax.vertex], range: match.range(at: 1))
let arrowRange = match.range(at: 2)
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.symbol],
+ [.foregroundColor: NSColor.Theme.Syntax.symbol],
range: NSMakeRange(arrowRange.lowerBound - 1, arrowRange.length + 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 3))
+ [.foregroundColor: NSColor.Theme.Syntax.vertex], range: match.range(at: 3))
}
matches = opportunityRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Theme.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Theme.Syntax.vertex], range: match.range(at: 2))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.symbol], range: match.range(at: 3))
+ [.foregroundColor: NSColor.Theme.Syntax.symbol], range: match.range(at: 3))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 4))
+ [.foregroundColor: NSColor.Theme.Syntax.number], range: match.range(at: 4))
}
matches = blockerRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Theme.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Theme.Syntax.vertex], range: match.range(at: 2))
}
matches = noteRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Theme.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Theme.Syntax.number], range: match.range(at: 2))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 3))
+ [.foregroundColor: NSColor.Theme.Syntax.number], range: match.range(at: 3))
}
matches = stageRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Theme.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Theme.Syntax.number], range: match.range(at: 2))
}
matches = groupRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Theme.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Theme.Syntax.vertex], range: match.range(at: 2))
}
}
}