Skip to content

Commit

Permalink
More general public TextInterfaceAdapter init
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Aug 31, 2023
1 parent db956d1 commit b498785
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/TextFormation/TextInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ public final class TextInterfaceAdapter: TextInterface {
let setSelection: (NSRange) -> Void
private let storage: TextStoring

@MainActor
public init(
getSelection: @escaping () -> NSRange,
setSelection: @escaping (NSRange) -> Void,
storage: TextStoring
) {
self.getSelection = getSelection
self.setSelection = setSelection
self.storage = storage
}

#if os(macOS)
@MainActor
public init(textView: NSTextView) {
Expand Down

0 comments on commit b498785

Please sign in to comment.