Skip to content

Commit 2a3fbe2

Browse files
committed
Use "default" color for diagnostic highlights
1 parent 1615c39 commit 2a3fbe2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Sources/SwiftDiagnostics/DiagnosticsFormatter.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ struct ANSIAnnotation {
372372
case magenta = 35
373373
case cyan = 36
374374
case white = 37
375+
case `default` = 39
375376
}
376377

377378
enum Trait: UInt8 {
@@ -414,6 +415,6 @@ struct ANSIAnnotation {
414415

415416
/// Annotation used for highlighting source text.
416417
static var sourceHighlight: ANSIAnnotation {
417-
ANSIAnnotation(color: .white, trait: .underline)
418+
ANSIAnnotation(color: .default, trait: .underline)
418419
}
419420
}

Tests/SwiftDiagnosticsTest/DiagnosticsFormatterTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ final class DiagnosticsFormatterTests: XCTestCase {
127127
"""
128128

129129
let expectedOutput = """
130-
\u{001B}[0;36m1 │\u{001B}[0;0m for \u{001B}[4;37m(i\u{001B}[0;0m \u{001B}[4;37m= 0; i != 10; i += 1)\u{001B}[0;0m { }
130+
\u{001B}[0;36m1 │\u{001B}[0;0m for \u{001B}[4;39m(i\u{001B}[0;0m \u{001B}[4;39m= 0; i != 10; i += 1)\u{001B}[0;0m { }
131131
\u{001B}[0;36m∣\u{001B}[0;0m │ ╰─ \u{001B}[1;31merror: expected ')' to end tuple pattern\u{001B}[0;0m
132132
\u{001B}[0;36m∣\u{001B}[0;0m ╰─ \u{001B}[1;31merror: C-style for statement has been removed in Swift 3\u{001B}[0;0m
133133

0 commit comments

Comments
 (0)