diff --git a/NvimView/Sources/NvimView/NvimView+TouchBar.swift b/NvimView/Sources/NvimView/NvimView+TouchBar.swift index 992e7c99..914b6d9f 100644 --- a/NvimView/Sources/NvimView/NvimView+TouchBar.swift +++ b/NvimView/Sources/NvimView/NvimView+TouchBar.swift @@ -62,7 +62,7 @@ extension NvimView: NSTouchBarDelegate, NSScrubberDataSource, NSScrubberDelegate func updateTouchBarCurrentBuffer() { self .allTabs() - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onSuccess: { [weak self] in self?.tabsCache = $0 @@ -83,7 +83,7 @@ extension NvimView: NSTouchBarDelegate, NSScrubberDataSource, NSScrubberDelegate func updateTouchBarTab() { self .allTabs() - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onSuccess: { [weak self] in self?.tabsCache = $0 diff --git a/NvimView/Sources/NvimView/NvimView+UiBridge.swift b/NvimView/Sources/NvimView/NvimView+UiBridge.swift index 73edb5d0..014eed04 100644 --- a/NvimView/Sources/NvimView/NvimView+UiBridge.swift +++ b/NvimView/Sources/NvimView/NvimView+UiBridge.swift @@ -186,7 +186,7 @@ extension NvimView { if event == .vimenter { Completable .empty() - .observeOn(SerialDispatchQueueScheduler(qos: .userInitiated)) + .observe(on: SerialDispatchQueueScheduler(qos: .userInitiated)) .andThen( Completable.create { completable in self.rpcEventSubscriptionCondition.wait(for: 5) @@ -245,7 +245,7 @@ extension NvimView { try? self.api .stop() .andThen(self.bridge.forceQuit()) - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .wait(onCompleted: { [weak self] in self?.bridgeLogger.fault("Successfully force-closed the bridge.") }, onError: { [weak self] in diff --git a/RxPack/Sources/RxPack/RxSwiftCommons.swift b/RxPack/Sources/RxPack/RxSwiftCommons.swift index 6df2b245..668f86c2 100644 --- a/RxPack/Sources/RxPack/RxSwiftCommons.swift +++ b/RxPack/Sources/RxPack/RxSwiftCommons.swift @@ -78,12 +78,12 @@ public extension PrimitiveSequence where Trait == SingleTrait { let disposable = self.subscribe(onSuccess: { result in value = result - + condition.lock() defer { condition.unlock() } trigger = true condition.broadcast() - }, onError: { _ in + }, onFailure: { _ in condition.lock() defer { condition.unlock() } trigger = true diff --git a/VimR/VimR/AdvencedPref.swift b/VimR/VimR/AdvencedPref.swift index db5478d7..b1a8f696 100644 --- a/VimR/VimR/AdvencedPref.swift +++ b/VimR/VimR/AdvencedPref.swift @@ -41,7 +41,7 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate { self.updateViews() source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if self.useInteractiveZsh != state.mainWindowTemplate.useInteractiveZsh || self.useSnapshotUpdate != state.useSnapshotUpdate diff --git a/VimR/VimR/AppDelegate.swift b/VimR/VimR/AppDelegate.swift index a5a9f256..966b4d1a 100644 --- a/VimR/VimR/AppDelegate.swift +++ b/VimR/VimR/AppDelegate.swift @@ -77,7 +77,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele ) source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { appState in self.hasMainWindows = !appState.mainWindows.isEmpty self.hasDirtyWindows = appState.mainWindows.values.reduce(false) { $1.isDirty ? true : $0 } diff --git a/VimR/VimR/AppearancePref.swift b/VimR/VimR/AppearancePref.swift index bb1fe3dc..7da2ffd3 100644 --- a/VimR/VimR/AppearancePref.swift +++ b/VimR/VimR/AppearancePref.swift @@ -53,7 +53,7 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate sharedFontManager.target = self source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in let appearance = state.mainWindowTemplate.appearance diff --git a/VimR/VimR/BufferList.swift b/VimR/VimR/BufferList.swift index 186033e1..7bed84fe 100644 --- a/VimR/VimR/BufferList.swift +++ b/VimR/VimR/BufferList.swift @@ -46,7 +46,7 @@ class BuffersList: NSView, self.addViews() source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if state.viewToBeFocused != nil, case .bufferList = state.viewToBeFocused! diff --git a/VimR/VimR/FileBrowser.swift b/VimR/VimR/FileBrowser.swift index e97ac440..75a7bfa6 100644 --- a/VimR/VimR/FileBrowser.swift +++ b/VimR/VimR/FileBrowser.swift @@ -50,7 +50,7 @@ class FileBrowser: NSView, self.innerCustomToolbar.fileBrowser = self source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if self.cwd != state.cwd { self.cwd = state.cwd diff --git a/VimR/VimR/FileOutlineView.swift b/VimR/VimR/FileOutlineView.swift index 3b0a293b..2cba18e8 100644 --- a/VimR/VimR/FileOutlineView.swift +++ b/VimR/VimR/FileOutlineView.swift @@ -51,7 +51,7 @@ class FileOutlineView: NSOutlineView, self.delegate = self source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if state.viewToBeFocused != nil, case .fileBrowser = state.viewToBeFocused! { self.beFirstResponder() diff --git a/VimR/VimR/GeneralPref.swift b/VimR/VimR/GeneralPref.swift index 2e6fbddb..4bdd8d69 100644 --- a/VimR/VimR/GeneralPref.swift +++ b/VimR/VimR/GeneralPref.swift @@ -41,7 +41,7 @@ class GeneralPref: PrefPane, UiComponent, NSTextFieldDelegate { .selectItem(at: indexToAfterLastWindowAction.firstIndex(of: state.afterLastWindowAction) ?? 0) source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if self.openWhenLaunchingCheckbox.boolState != state.openNewMainWindowOnLaunch { self.openWhenLaunchingCheckbox.boolState = state.openNewMainWindowOnLaunch diff --git a/VimR/VimR/HtmlPreviewTool.swift b/VimR/VimR/HtmlPreviewTool.swift index 7c6d7944..6b39f1c8 100644 --- a/VimR/VimR/HtmlPreviewTool.swift +++ b/VimR/VimR/HtmlPreviewTool.swift @@ -50,7 +50,7 @@ class HtmlPreviewTool: NSView, UiComponent, WKNavigationDelegate { } source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if state.viewToBeFocused != nil, case .htmlPreview = state.viewToBeFocused! { self.beFirstResponder() } diff --git a/VimR/VimR/KeysPref.swift b/VimR/VimR/KeysPref.swift index 017b3f64..384c2be5 100644 --- a/VimR/VimR/KeysPref.swift +++ b/VimR/VimR/KeysPref.swift @@ -35,7 +35,7 @@ class KeysPref: PrefPane, UiComponent, NSTextFieldDelegate { self.updateViews() source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if self.isLeftOptionMeta != state.mainWindowTemplate.isLeftOptionMeta || self.isRightOptionMeta != state.mainWindowTemplate.isRightOptionMeta diff --git a/VimR/VimR/MainWindow+Actions.swift b/VimR/VimR/MainWindow+Actions.swift index 132b3bf4..d5a278fb 100644 --- a/VimR/VimR/MainWindow+Actions.swift +++ b/VimR/VimR/MainWindow+Actions.swift @@ -166,7 +166,7 @@ extension MainWindow { @IBAction func saveDocument(_: Any?) { self.neoVimView .currentBuffer() - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .flatMapCompletable { curBuf -> Completable in if curBuf.url == nil { self.savePanelSheet { @@ -187,7 +187,7 @@ extension MainWindow { @IBAction func saveDocumentAs(_: Any?) { self.neoVimView .currentBuffer() - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onSuccess: { curBuf in self.savePanelSheet { url in self.neoVimView diff --git a/VimR/VimR/MainWindow.swift b/VimR/VimR/MainWindow.swift index ab35c801..e9dcaba5 100644 --- a/VimR/VimR/MainWindow.swift +++ b/VimR/VimR/MainWindow.swift @@ -275,7 +275,7 @@ class MainWindow: NSObject, private func subscribeToNvimViewEvents() { self.neoVimView.events - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { [weak self] event in switch event { case .neoVimStopped: self?.neoVimStopped() @@ -325,7 +325,7 @@ class MainWindow: NSObject, private func subscribeToStateChange(source: Observable) { source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if self.isClosing { return diff --git a/VimR/VimR/MarkdownTool.swift b/VimR/VimR/MarkdownTool.swift index 663d1731..33bd84a6 100644 --- a/VimR/VimR/MarkdownTool.swift +++ b/VimR/VimR/MarkdownTool.swift @@ -79,7 +79,7 @@ class MarkdownTool: NSView, UiComponent, WKNavigationDelegate { if let url = state.preview.server { self.webview.load(URLRequest(url: url)) } source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if state.viewToBeFocused != nil, case .markdownPreview = state.viewToBeFocused! diff --git a/VimR/VimR/OpenQuicklyWindow.swift b/VimR/VimR/OpenQuicklyWindow.swift index 32b09c3e..606ac434 100644 --- a/VimR/VimR/OpenQuicklyWindow.swift +++ b/VimR/VimR/OpenQuicklyWindow.swift @@ -55,7 +55,7 @@ class OpenQuicklyWindow: NSObject, self.addViews() source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { [weak self] state in self?.subscription(state) }) .disposed(by: self.disposeBag) } @@ -145,7 +145,7 @@ class OpenQuicklyWindow: NSObject, self.cwdControl.url = cwd self.searchStream - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { [weak self] pattern in self?.scanAndScore(pattern) }) diff --git a/VimR/VimR/PrefWindow.swift b/VimR/VimR/PrefWindow.swift index 98caa0c5..aa9b90e4 100644 --- a/VimR/VimR/PrefWindow.swift +++ b/VimR/VimR/PrefWindow.swift @@ -40,7 +40,7 @@ class PrefWindow: NSObject, self.addViews() source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if state.preferencesOpen.payload == false { self.openStatusMark = state.preferencesOpen.mark diff --git a/VimR/VimR/RxRedux.swift b/VimR/VimR/RxRedux.swift index 68b6116e..cea9f52d 100644 --- a/VimR/VimR/RxRedux.swift +++ b/VimR/VimR/RxRedux.swift @@ -112,7 +112,7 @@ protocol UiComponent { class ActionEmitter { var observable: Observable { - self.subject.asObservable().observeOn(self.scheduler) + self.subject.asObservable().observe(on: self.scheduler) } func typedEmit() -> (T) -> Void {{ (action: T) in self.subject.onNext(action) } } @@ -149,7 +149,7 @@ class ReduxContext { init(initialState: ReduxTypes.StateType) { self.state = initialState - self.stateSource = self.stateSubject.asObservable().observeOn(self.stateScheduler) + self.stateSource = self.stateSubject.asObservable().observe(on: self.stateScheduler) } func terminate() { diff --git a/VimR/VimR/ToolsPref.swift b/VimR/VimR/ToolsPref.swift index 5b94c903..ffe79d35 100644 --- a/VimR/VimR/ToolsPref.swift +++ b/VimR/VimR/ToolsPref.swift @@ -33,7 +33,7 @@ class ToolsPref: PrefPane, UiComponent { self.updateViews() source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { _ in self.updateViews() diff --git a/VimR/VimR/Types.swift b/VimR/VimR/Types.swift index c4b1c9d9..f19ff963 100644 --- a/VimR/VimR/Types.swift +++ b/VimR/VimR/Types.swift @@ -104,7 +104,7 @@ class UiComponentTemplate: UiComponent { // react to the new state source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe( onNext: { _ in Swift.print("Hello, \(self.someField)") diff --git a/VimR/VimR/UiRoot.swift b/VimR/VimR/UiRoot.swift index eab055a1..0f5cc268 100644 --- a/VimR/VimR/UiRoot.swift +++ b/VimR/VimR/UiRoot.swift @@ -26,7 +26,7 @@ class UiRoot: UiComponent { self.prefWindow = PrefWindow(source: source, emitter: emitter, state: state) source - .observeOn(MainScheduler.instance) + .observe(on: MainScheduler.instance) .subscribe(onNext: { state in let uuidsInState = Set(state.mainWindows.keys)