Skip to content

Commit cab7931

Browse files
committed
Linter
1 parent c216bea commit cab7931

File tree

3 files changed

+33
-27
lines changed

3 files changed

+33
-27
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//
2+
// TextView+Lifecycle.swift
3+
// CodeEditTextView
4+
//
5+
// Created by Khan Winter on 4/7/25.
6+
//
7+
8+
extension TextView {
9+
override public func layout() {
10+
layoutManager.layoutLines()
11+
super.layout()
12+
}
13+
14+
override public func viewWillMove(toWindow newWindow: NSWindow?) {
15+
super.viewWillMove(toWindow: newWindow)
16+
layoutManager.layoutLines()
17+
}
18+
19+
override public func viewWillMove(toSuperview newSuperview: NSView?) {
20+
guard let scrollView = enclosingScrollView else {
21+
return
22+
}
23+
24+
setUpScrollListeners(scrollView: scrollView)
25+
}
26+
27+
override public func viewDidEndLiveResize() {
28+
super.viewDidEndLiveResize()
29+
updateFrameIfNeeded()
30+
}
31+
}

Sources/CodeEditTextView/TextView/TextView+Mouse.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ extension TextView {
163163
selectionManager.setSelectedRange(selectedRange)
164164
setNeedsDisplay()
165165
}
166-
166+
167167
/// Sets up a timer that fires at a predetermined period to autoscroll the text view.
168168
/// Ensure the timer is disabled using ``disableMouseAutoscrollTimer``.
169169
func setUpMouseAutoscrollTimer() {
@@ -176,7 +176,7 @@ extension TextView {
176176
}
177177
}
178178
}
179-
179+
180180
/// Disables the mouse drag timer started by ``setUpMouseAutoscrollTimer``
181181
func disableMouseAutoscrollTimer() {
182182
mouseDragTimer?.invalidate()

Sources/CodeEditTextView/TextView/TextView.swift

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -356,31 +356,6 @@ public class TextView: NSView, NSTextContent {
356356
NSRange(location: 0, length: textStorage.length)
357357
}
358358

359-
// MARK: - View Lifecycle
360-
361-
override public func layout() {
362-
layoutManager.layoutLines()
363-
super.layout()
364-
}
365-
366-
override public func viewWillMove(toWindow newWindow: NSWindow?) {
367-
super.viewWillMove(toWindow: newWindow)
368-
layoutManager.layoutLines()
369-
}
370-
371-
override public func viewWillMove(toSuperview newSuperview: NSView?) {
372-
guard let scrollView = enclosingScrollView else {
373-
return
374-
}
375-
376-
setUpScrollListeners(scrollView: scrollView)
377-
}
378-
379-
override public func viewDidEndLiveResize() {
380-
super.viewDidEndLiveResize()
381-
updateFrameIfNeeded()
382-
}
383-
384359
// MARK: - Hit test
385360

386361
/// Returns the responding view for a given point.

0 commit comments

Comments
 (0)