Skip to content

Commit 72b03e5

Browse files
committed
Set scrollView background color
Updates the scroll view's background color to the theme's background color to avoid ugly edges on scroll.
1 parent 0eeb89c commit 72b03e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/CodeEditTextView/STTextViewController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public class STTextViewController: NSViewController, STTextViewDelegate, ThemeAt
1717

1818
internal var textView: STTextView!
1919

20+
internal var scrollView: NSScrollView!
21+
2022
internal var rulerView: STLineNumberRulerView!
2123

2224
/// Binding for the `textView`s string
@@ -85,7 +87,7 @@ public class STTextViewController: NSViewController, STTextViewDelegate, ThemeAt
8587
public override func loadView() {
8688
textView = STTextView()
8789

88-
let scrollView = NSScrollView()
90+
scrollView = NSScrollView()
8991
scrollView.translatesAutoresizingMaskIntoConstraints = false
9092
scrollView.hasVerticalScroller = true
9193
scrollView.documentView = textView
@@ -211,6 +213,8 @@ public class STTextViewController: NSViewController, STTextViewDelegate, ThemeAt
211213
rulerView?.separatorColor = theme.invisibles
212214
rulerView?.baselineOffset = baselineOffset
213215

216+
scrollView?.backgroundColor = theme.background
217+
214218
(view as? NSScrollView)?.contentView.contentInsets.bottom = bottomContentInsets
215219

216220
setStandardAttributes()

0 commit comments

Comments
 (0)