Skip to content

Commit a85d9ed

Browse files
committed
update size after layout
1 parent 57a462a commit a85d9ed

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/STTextViewAppKit/STTextView+NSTextViewportLayoutControllerDelegate.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ extension STTextView: NSTextViewportLayoutControllerDelegate {
4242
contentView.subviews.removeAll {
4343
type(of: $0) != STInsertionPointView.self
4444
}
45-
46-
sizeToFit()
4745
}
4846

4947
public func textViewportLayoutController(_ textViewportLayoutController: NSTextViewportLayoutController, configureRenderingSurfaceFor textLayoutFragment: NSTextLayoutFragment) {
@@ -73,6 +71,7 @@ extension STTextView: NSTextViewportLayoutControllerDelegate {
7371
}
7472

7573
public func textViewportLayoutControllerDidLayout(_ textViewportLayoutController: NSTextViewportLayoutController) {
74+
sizeToFit()
7675
updateSelectedRangeHighlight()
7776
layoutGutter()
7877
updateSelectedLineHighlight()

0 commit comments

Comments
 (0)