File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
Sources/CodeEditSourceEditor/Controller Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ extension TextViewController {
2929 )
3030
3131 minimapView = MinimapView ( textView: textView, theme: theme)
32+ minimapView. postsFrameChangedNotifications = true
3233 minimapView. isHidden = !showMinimap
3334 scrollView. addFloatingSubview ( minimapView, for: . vertical)
3435
@@ -68,7 +69,7 @@ extension TextViewController {
6869 func setUpConstraints( ) {
6970 guard let findViewController else { return }
7071
71- let maxWidthConstraint = minimapView. widthAnchor. constraint ( lessThanOrEqualToConstant: 150 )
72+ let maxWidthConstraint = minimapView. widthAnchor. constraint ( lessThanOrEqualToConstant: 140 )
7273 let relativeWidthConstraint = minimapView. widthAnchor. constraint (
7374 equalTo: view. widthAnchor,
7475 multiplier: 0.17
Original file line number Diff line number Diff line change 77
88import AppKit
99
10- extension TextViewController [
10+ extension TextViewController {
1111 func reloadUI( ) {
1212 textView. isEditable = isEditable
1313 textView. isSelectable = isSelectable
@@ -20,4 +20,4 @@ extension TextViewController [
2020 minimapView. updateContentViewHeight ( )
2121 minimapView. updateDocumentVisibleViewPosition ( )
2222 }
23- ]
23+ }
Original file line number Diff line number Diff line change @@ -328,6 +328,13 @@ public class TextViewController: NSViewController {
328328 /// A default `NSParagraphStyle` with a set `lineHeight`
329329 package lazy var paragraphStyle : NSMutableParagraphStyle = generateParagraphStyle ( )
330330
331+ override public func viewWillAppear( ) {
332+ super. viewWillAppear ( )
333+ // The calculation this causes cannot be done until the view knows it's final position
334+ updateTextInsets ( )
335+ minimapView. layout ( )
336+ }
337+
331338 deinit {
332339 if let highlighter {
333340 textView. removeStorageDelegate ( highlighter)
You can’t perform that action at this time.
0 commit comments