1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-26 23:36:08 +03:00

Adapt to RxSwift 6.2

This commit is contained in:
Tae Won Ha 2021-06-18 08:54:53 +02:00
parent 7093d96b0f
commit b059010f55
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -43,14 +43,14 @@ extension NvimView {
case .insert, .replace: case .insert, .replace:
self.api self.api
.input(keys: "<Esc>ui", errWhenBlocked: false) .input(keys: "<Esc>ui", errWhenBlocked: false)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not undo", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not undo", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
case .normal, .visual: case .normal, .visual:
self.api self.api
.input(keys: "u", errWhenBlocked: false) .input(keys: "u", errWhenBlocked: false)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not undo", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not undo", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
@ -64,14 +64,14 @@ extension NvimView {
case .insert, .replace: case .insert, .replace:
self.api self.api
.input(keys: "<Esc><C-r>i", errWhenBlocked: false) .input(keys: "<Esc><C-r>i", errWhenBlocked: false)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not redo", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not redo", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
case .normal, .visual: case .normal, .visual:
self.api self.api
.input(keys: "<C-r>", errWhenBlocked: false) .input(keys: "<C-r>", errWhenBlocked: false)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not redo", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not redo", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
@ -85,7 +85,7 @@ extension NvimView {
case .visual, .normal: case .visual, .normal:
self.api self.api
.input(keys: "\"+d", errWhenBlocked: false) .input(keys: "\"+d", errWhenBlocked: false)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not cut", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not cut", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
@ -99,7 +99,7 @@ extension NvimView {
case .visual, .normal: case .visual, .normal:
self.api self.api
.input(keys: "\"+y", errWhenBlocked: false) .input(keys: "\"+y", errWhenBlocked: false)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not copy", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not copy", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
@ -114,7 +114,7 @@ extension NvimView {
// phase == 1 means paste in a single call // phase == 1 means paste in a single call
self.api self.api
.paste(data: content, crlf: false, phase: -1) .paste(data: content, crlf: false, phase: -1)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not paste \(content)", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not paste \(content)", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
@ -125,7 +125,7 @@ extension NvimView {
case .normal, .visual: case .normal, .visual:
self.api self.api
.input(keys: "x", errWhenBlocked: false) .input(keys: "x", errWhenBlocked: false)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not delete", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not delete", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
@ -139,14 +139,14 @@ extension NvimView {
case .insert, .visual: case .insert, .visual:
self.api self.api
.input(keys: "<Esc>ggVG", errWhenBlocked: false) .input(keys: "<Esc>ggVG", errWhenBlocked: false)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not select all", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not select all", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
default: default:
self.api self.api
.input(keys: "ggVG", errWhenBlocked: false) .input(keys: "ggVG", errWhenBlocked: false)
.subscribe(onError: { [weak self] error in .subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not select all", cause: error)) self?.eventsSubject.onNext(.apiError(msg: "Could not select all", cause: error))
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)