mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-20 15:47:57 +03:00
Add @MainActor to some view methods
This commit is contained in:
parent
8e9a049270
commit
af9d522c70
@ -59,7 +59,7 @@ struct FindPanelResultView: View {
|
||||
|
||||
typealias Match = TextFindAllResult.Match
|
||||
|
||||
final class Model: ObservableObject {
|
||||
@MainActor final class Model: ObservableObject {
|
||||
|
||||
@Published var matches: [Match] = []
|
||||
@Published var findString: String = ""
|
||||
@ -153,7 +153,7 @@ struct FindPanelResultView: View {
|
||||
}
|
||||
|
||||
|
||||
private var message: String {
|
||||
@MainActor private var message: String {
|
||||
|
||||
let documentName = self.model.target?.documentName ?? "Unknown" // This should never be nil.
|
||||
|
||||
|
@ -180,7 +180,7 @@ struct SyntaxEditView: View {
|
||||
}
|
||||
|
||||
|
||||
@ViewBuilder private var detailView: some View {
|
||||
@MainActor @ViewBuilder private var detailView: some View {
|
||||
|
||||
switch self.pane {
|
||||
case .keywords:
|
||||
@ -220,7 +220,7 @@ struct SyntaxEditView: View {
|
||||
// MARK: Private Methods
|
||||
|
||||
/// Submits the syntax if it is valid.
|
||||
private func submit() {
|
||||
@MainActor private func submit() {
|
||||
|
||||
// syntax name validation
|
||||
self.name = self.name.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
@ -249,7 +249,7 @@ struct SyntaxEditView: View {
|
||||
|
||||
|
||||
/// Restores the current settings in editor to the user default.
|
||||
private func restore() {
|
||||
@MainActor private func restore() {
|
||||
|
||||
guard
|
||||
self.isBundled,
|
||||
|
@ -55,6 +55,7 @@ struct ValueRange<Value> {
|
||||
|
||||
extension ValueRange: Equatable where Value: Equatable { }
|
||||
extension ValueRange: Hashable where Value: Hashable { }
|
||||
extension ValueRange: Sendable where Value: Sendable { }
|
||||
|
||||
extension ValueRange: Identifiable where Self: Hashable {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user