File tree Expand file tree Collapse file tree 4 files changed +40
-22
lines changed
Sources/CodeEditSourceEditor Expand file tree Collapse file tree 4 files changed +40
-22
lines changed Original file line number Diff line number Diff line change 1+ //
2+ // TextViewController+GutterViewDelegate.swift
3+ // CodeEditSourceEditor
4+ //
5+ // Created by Khan Winter on 4/17/25.
6+ //
7+
8+ import Foundation
9+
10+ extension TextViewController : GutterViewDelegate {
11+ public func gutterViewWidthDidUpdate( newWidth: CGFloat ) {
12+ gutterView? . frame. size. width = newWidth
13+ textView? . textInsets = textViewInsets
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ //
2+ // TextViewController+ReloadUI.swift
3+ // CodeEditSourceEditor
4+ //
5+ // Created by Khan Winter on 4/17/25.
6+ //
7+
8+ import AppKit
9+
10+ extension TextViewController [
11+ func reloadUI( ) {
12+ textView. isEditable = isEditable
13+ textView. isSelectable = isSelectable
14+
15+ styleScrollView ( )
16+ styleTextView ( )
17+ styleGutterView ( )
18+
19+ highlighter? . invalidate ( )
20+ minimapView. updateContentViewHeight ( )
21+ minimapView. updateDocumentVisibleViewPosition ( )
22+ }
23+ ]
Original file line number Diff line number Diff line change @@ -328,21 +328,6 @@ public class TextViewController: NSViewController {
328328 /// A default `NSParagraphStyle` with a set `lineHeight`
329329 package lazy var paragraphStyle : NSMutableParagraphStyle = generateParagraphStyle ( )
330330
331- // MARK: - Reload UI
332-
333- func reloadUI( ) {
334- textView. isEditable = isEditable
335- textView. isSelectable = isSelectable
336-
337- styleScrollView ( )
338- styleTextView ( )
339- styleGutterView ( )
340-
341- highlighter? . invalidate ( )
342- minimapView. updateContentViewHeight ( )
343- minimapView. updateDocumentVisibleViewPosition ( )
344- }
345-
346331 deinit {
347332 if let highlighter {
348333 textView. removeStorageDelegate ( highlighter)
@@ -361,10 +346,3 @@ public class TextViewController: NSViewController {
361346 localEvenMonitor = nil
362347 }
363348}
364-
365- extension TextViewController : GutterViewDelegate {
366- public func gutterViewWidthDidUpdate( newWidth: CGFloat ) {
367- gutterView? . frame. size. width = newWidth
368- textView? . textInsets = textViewInsets
369- }
370- }
Original file line number Diff line number Diff line change @@ -246,6 +246,8 @@ public class MinimapView: FlippedNSView {
246246 override public func layout( ) {
247247 layoutManager? . layoutLines ( )
248248 super. layout ( )
249+ updateContentViewHeight ( )
250+ updateDocumentVisibleViewPosition ( )
249251 }
250252
251253 override public func hitTest( _ point: NSPoint ) -> NSView ? {
You can’t perform that action at this time.
0 commit comments