1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00

Adapt to RxSwift 6.2

This commit is contained in:
Tae Won Ha 2021-06-18 08:52:29 +02:00
parent 507e2d6973
commit f4626b7255
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -65,16 +65,16 @@ extension NvimView: NSTouchBarDelegate, NSScrubberDataSource, NSScrubberDelegate
.observe(on: MainScheduler.instance)
.subscribe(onSuccess: { [weak self] in
self?.tabsCache = $0
guard let tabsControl = self?.getTabsControl() else { return }
tabsControl.reloadData()
let scrubberProportionalLayout = tabsControl.scrubberLayout as! NSScrubberProportionalLayout
scrubberProportionalLayout.numberOfVisibleItems = tabsControl
.numberOfItems > 0 ? tabsControl.numberOfItems : 1
tabsControl.selectedIndex = self?.selectedTabIndex() ?? tabsControl.selectedIndex
}, onError: { [weak self] error in
}, onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not get all tabpages.", cause: error))
})
.disposed(by: self.disposeBag)
@ -86,12 +86,12 @@ extension NvimView: NSTouchBarDelegate, NSScrubberDataSource, NSScrubberDelegate
.observe(on: MainScheduler.instance)
.subscribe(onSuccess: { [weak self] in
self?.tabsCache = $0
guard let tabsControl = self?.getTabsControl() else { return }
tabsControl.reloadData()
tabsControl.selectedIndex = self?.selectedTabIndex() ?? tabsControl.selectedIndex
}, onError: { error in
}, onFailure: { error in
self.eventsSubject.onNext(.apiError(msg: "Could not get all tabpages.", cause: error))
})
.disposed(by: self.disposeBag)
@ -121,7 +121,7 @@ extension NvimView: NSTouchBarDelegate, NSScrubberDataSource, NSScrubberDelegate
let window = tab.currentWindow ?? tab.windows[0]
self.api
.setCurrentWin(window: RxNeovimApi.Window(window.handle))
.subscribeOn(self.scheduler)
.subscribe(on: self.scheduler)
.subscribe(onError: { [weak self] error in
self?.eventsSubject
.onNext(.apiError(msg: "Could not set current window to \(window.handle).", cause: error))