Skip to content

Commit a7b54a3

Browse files
committed
ST_LAYOUT_DEBUG debugging environment
1 parent e6d78e8 commit a7b54a3

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

Sources/STTextViewAppKit/Gutter/STGutterLineNumberCell.swift

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ final class STGutterLineNumberCell: NSView {
2626
super.init(frame: .zero)
2727
wantsLayer = true
2828
clipsToBounds = true
29+
30+
if ProcessInfo().environment["ST_LAYOUT_DEBUG"] == "YES" {
31+
layer?.backgroundColor = NSColor.systemOrange.withAlphaComponent(0.05).cgColor
32+
layer?.borderColor = NSColor.systemOrange.cgColor
33+
layer?.borderWidth = 0.5
34+
}
2935
}
3036

3137
override var isFlipped: Bool {

Sources/STTextViewAppKit/STTextLayoutFragmentView.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ final class STTextLayoutFragmentView: NSView {
2626
super.init(frame: frame)
2727
wantsLayer = true
2828
clipsToBounds = false // allow overdraw invisible characters
29-
// layer?.backgroundColor = NSColor.red.withAlphaComponent(0.2).cgColor
29+
30+
if ProcessInfo().environment["ST_LAYOUT_DEBUG"] == "YES" {
31+
layer?.backgroundColor = NSColor.systemOrange.withAlphaComponent(0.05).cgColor
32+
layer?.borderColor = NSColor.systemOrange.cgColor
33+
layer?.borderWidth = 0.5
34+
}
3035

3136
needsDisplay = true
3237
}

TextEdit/TextEdit.xcodeproj/xcshareddata/xcschemes/TextEdit.xcscheme

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
value = "YES"
6363
isEnabled = "NO">
6464
</EnvironmentVariable>
65+
<EnvironmentVariable
66+
key = "ST_LAYOUT_DEBUG"
67+
value = "YES"
68+
isEnabled = "NO">
69+
</EnvironmentVariable>
6570
</EnvironmentVariables>
6671
</LaunchAction>
6772
<ProfileAction

0 commit comments

Comments
 (0)