Skip to content

Commit 36b86c4

Browse files
Updates
1 parent b7e3175 commit 36b86c4

File tree

7 files changed

+17
-29
lines changed

7 files changed

+17
-29
lines changed

Package.resolved

Lines changed: 2 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ let package = Package(
1616
dependencies: [
1717
// A fast, efficient, text view for code.
1818
.package(
19-
url: "https://github.com/CodeEditApp/CodeEditTextView.git",
20-
from: "0.7.6"
19+
// url: "https://github.com/CodeEditApp/CodeEditTextView.git",
20+
// from: "0.7.6"
21+
path: "../CodeEditTextView"
2122
),
2223
// tree-sitter languages
2324
.package(

Sources/CodeEditSourceEditor/CodeEditSourceEditor/CodeEditSourceEditor.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
4242
/// character's width between characters, etc. Defaults to `1.0`
4343
/// - bracketPairHighlight: The type of highlight to use to highlight bracket pairs.
4444
/// See `BracketPairHighlight` for more information. Defaults to `nil`
45-
/// - useSystemCursor: If true, uses the system cursor on `>=macOS 14`.
4645
/// - undoManager: The undo manager for the text view. Defaults to `nil`, which will create a new CEUndoManager
4746
/// - coordinators: Any text coordinators for the view to use. See ``TextViewCoordinator`` for more information.
4847
public init(
@@ -191,6 +190,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
191190

192191
public typealias NSViewControllerType = TextViewController
193192

193+
// TODO: SET COMPLETIONPROVIDER FOR TEXTVIEW
194194
public func makeNSViewController(context: Context) -> TextViewController {
195195
let controller = TextViewController(
196196
string: "",
@@ -235,6 +235,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
235235
Coordinator(text: text, cursorPositions: cursorPositions)
236236
}
237237

238+
// TODO: SET COMPLETIONPROVIDER FOR TEXTVIEW
238239
public func updateNSViewController(_ controller: TextViewController, context: Context) {
239240
if !context.coordinator.isUpdateFromTextView {
240241
// Prevent infinite loop of update notifications
@@ -301,10 +302,6 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
301302
controller.letterSpacing = letterSpacing
302303
}
303304

304-
if controller.useSystemCursor != useSystemCursor {
305-
controller.useSystemCursor = useSystemCursor
306-
}
307-
308305
controller.bracketPairHighlight = bracketPairHighlight
309306
}
310307

@@ -325,8 +322,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
325322
controller.indentOption == indentOption &&
326323
controller.tabWidth == tabWidth &&
327324
controller.letterSpacing == letterSpacing &&
328-
controller.bracketPairHighlight == bracketPairHighlight &&
329-
controller.useSystemCursor == useSystemCursor
325+
controller.bracketPairHighlight == bracketPairHighlight
330326
}
331327
}
332328

Sources/CodeEditSourceEditor/Controller/TextViewController+LoadView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ extension TextViewController {
110110
}
111111
.store(in: &cancellables)
112112

113-
if let localEventMonitor = self.localEvenMonitor {
113+
if let localEventMonitor = self.localEventMonitor {
114114
NSEvent.removeMonitor(localEventMonitor)
115115
}
116-
self.localEvenMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [weak self] event in
116+
self.localEventMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [weak self] event in
117117
guard self?.view.window?.firstResponder == self?.textView else { return event }
118118

119119
let tabKey: UInt16 = 0x30
@@ -126,6 +126,7 @@ extension TextViewController {
126126
}
127127
}
128128
}
129+
129130
func handleCommand(event: NSEvent, modifierFlags: UInt) -> NSEvent? {
130131
let commandKey = NSEvent.ModifierFlags.command.rawValue
131132

Sources/CodeEditSourceEditor/Controller/TextViewController.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class TextViewController: NSViewController {
2828
internal var highlightLayers: [CALayer] = []
2929
internal var systemAppearance: NSAppearance.Name?
3030

31-
package var localEvenMonitor: Any?
31+
package var localEventMonitor: Any?
3232
package var isPostingCursorNotification: Bool = false
3333

3434
/// The string contents.
@@ -254,7 +254,6 @@ public class TextViewController: NSViewController {
254254
isEditable: isEditable,
255255
isSelectable: isSelectable,
256256
letterSpacing: letterSpacing,
257-
useSystemCursor: platformGuardedSystemCursor,
258257
delegate: self
259258
)
260259

@@ -305,10 +304,10 @@ public class TextViewController: NSViewController {
305304
textCoordinators.removeAll()
306305
NotificationCenter.default.removeObserver(self)
307306
cancellables.forEach { $0.cancel() }
308-
if let localEvenMonitor {
309-
NSEvent.removeMonitor(localEvenMonitor)
307+
if let localEventMonitor {
308+
NSEvent.removeMonitor(localEventMonitor)
310309
}
311-
localEvenMonitor = nil
310+
localEventMonitor = nil
312311
}
313312
}
314313

Sources/CodeEditSourceEditor/Extensions/TextView+/TextView+TextFormation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension TextView: TextInterface {
4646
textStorage.beginEditing()
4747

4848
layoutManager.willReplaceCharactersInRange(range: mutation.range, with: mutation.string)
49-
_undoManager?.registerMutation(mutation)
49+
// _undoManager?.registerMutation(mutation)
5050
textStorage.replaceCharacters(in: mutation.range, with: mutation.string)
5151
selectionManager.didReplaceCharacters(
5252
in: mutation.range,

Sources/CodeEditSourceEditor/Gutter/GutterView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import AppKit
99
import CodeEditTextView
10-
import CodeEditTextViewObjC
10+
//import CodeEditTextViewObjC
1111

1212
public protocol GutterViewDelegate: AnyObject {
1313
func gutterViewWidthDidUpdate(newWidth: CGFloat)

0 commit comments

Comments
 (0)