Skip to content

Commit ddef66c

Browse files
committed
Fixed swiftlint errors.
1 parent 5a0fa9c commit ddef66c

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Sources/CodeEditSourceEditor/Controller/TextViewController+LoadView.swift

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ extension TextViewController {
107107
])
108108
}
109109

110-
func setUpOberservers() {
110+
func setUpOnScrollChangeObserver() {
111111
// Layout on scroll change
112112
NotificationCenter.default.addObserver(
113113
forName: NSView.boundsDidChangeNotification,
@@ -120,7 +120,9 @@ extension TextViewController {
120120
self?.gutterView.needsDisplay = true
121121
self?.minimapXConstraint?.constant = clipView.bounds.origin.x
122122
}
123+
}
123124

125+
func setUpOnScrollViewFrameChangeObserver() {
124126
// Layout on frame change
125127
NotificationCenter.default.addObserver(
126128
forName: NSView.frameDidChangeNotification,
@@ -132,7 +134,9 @@ extension TextViewController {
132134
self?.emphasisManager?.removeEmphases(for: EmphasisGroup.brackets)
133135
self?.updateTextInsets()
134136
}
137+
}
135138

139+
func setUpTextViewFrameChangeObserver() {
136140
NotificationCenter.default.addObserver(
137141
forName: NSView.frameDidChangeNotification,
138142
object: textView,
@@ -147,7 +151,9 @@ extension TextViewController {
147151
self?.guideView?.updatePosition(in: textView)
148152
self?.scrollView.needsLayout = true
149153
}
154+
}
150155

156+
func setUpSelectionChangedObserver() {
151157
NotificationCenter.default.addObserver(
152158
forName: TextSelectionManager.selectionChangedNotification,
153159
object: textView.selectionManager,
@@ -156,7 +162,9 @@ extension TextViewController {
156162
self?.updateCursorPosition()
157163
self?.emphasizeSelectionPairs()
158164
}
165+
}
159166

167+
func setUpAppearanceChangedObserver() {
160168
NSApp.publisher(for: \.effectiveAppearance)
161169
.receive(on: RunLoop.main)
162170
.sink { [weak self] newValue in
@@ -173,6 +181,14 @@ extension TextViewController {
173181
.store(in: &cancellables)
174182
}
175183

184+
func setUpOberservers() {
185+
setUpOnScrollChangeObserver()
186+
setUpOnScrollViewFrameChangeObserver()
187+
setUpTextViewFrameChangeObserver()
188+
setUpSelectionChangedObserver()
189+
setUpAppearanceChangedObserver()
190+
}
191+
176192
func setUpKeyBindings(eventMonitor: inout Any?) {
177193
eventMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [weak self] event -> NSEvent? in
178194
guard let self = self else { return event }

Sources/CodeEditSourceEditor/Controller/TextViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import TextFormation
1616
///
1717
/// A view controller class for managing a source editor. Uses ``CodeEditTextView/TextView`` for input and rendering,
1818
/// tree-sitter for syntax highlighting, and TextFormation for live editing completions.
19-
public class TextViewController: NSViewController {
19+
public class TextViewController: NSViewController { // swiftlint:disable:this type_body_length
2020
// swiftlint:disable:next line_length
2121
public static let cursorPositionUpdatedNotification: Notification.Name = .init("TextViewController.cursorPositionNotification")
2222

0 commit comments

Comments
 (0)