File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Sources/CodeEditSourceEditor/Controller Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,7 @@ extension TextViewController {
2323 delegate: self
2424 )
2525 gutterView. updateWidthIfNeeded ( )
26- scrollView. addFloatingSubview (
27- gutterView,
28- for: . horizontal
29- )
26+ scrollView. addFloatingSubview ( gutterView, for: . horizontal)
3027
3128 minimapView = MinimapView ( textView: textView, theme: theme)
3229 scrollView. addFloatingSubview ( minimapView, for: . vertical)
@@ -90,6 +87,8 @@ extension TextViewController {
9087 minimapXConstraint,
9188 maxWidthConstraint,
9289 relativeWidthConstraint,
90+
91+ gutterView. topAnchor. constraint ( equalTo: textView. topAnchor)
9392 ] )
9493 }
9594
@@ -123,7 +122,11 @@ extension TextViewController {
123122 object: textView,
124123 queue: . main
125124 ) { [ weak self] _ in
126- self ? . gutterView. frame. size. height = ( self ? . textView. frame. height ?? 0 ) + 10
125+ guard let scrollView = self ? . scrollView else { return }
126+ self ? . gutterView. frame. size. height = max (
127+ ( self ? . textView. frame. height ?? 0 ) + 10 ,
128+ ( self ? . scrollView. documentVisibleRect. height ?? 0.0 ) + ( self ? . scrollView. contentInsets. vertical ?? 0.0 )
129+ )
127130 self ? . gutterView. needsDisplay = true
128131 }
129132
You can’t perform that action at this time.
0 commit comments