Skip to content

Commit d121483

Browse files
authored
Show horizontal scrollbar only when wrapLines is off (#249)
1 parent d2f655a commit d121483

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Sources/CodeEditSourceEditor/Controller/TextViewController+LoadView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extension TextViewController {
1818
scrollView.translatesAutoresizingMaskIntoConstraints = false
1919
scrollView.contentView.postsFrameChangedNotifications = true
2020
scrollView.hasVerticalScroller = true
21-
scrollView.hasHorizontalScroller = true
21+
scrollView.hasHorizontalScroller = !wrapLines
2222
scrollView.documentView = textView
2323
scrollView.contentView.postsBoundsChangedNotifications = true
2424

Sources/CodeEditSourceEditor/Controller/TextViewController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public class TextViewController: NSViewController {
9191
public var wrapLines: Bool {
9292
didSet {
9393
textView.layoutManager.wrapLines = wrapLines
94+
scrollView.hasHorizontalScroller = !wrapLines
9495
}
9596
}
9697

0 commit comments

Comments
 (0)