1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-09-11 17:15:34 +03:00

Refactor slightly

This commit is contained in:
Tae Won Ha 2023-12-19 18:52:40 +01:00
parent 6c7ce0fc77
commit 8dcd0cd1b3
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 7 additions and 13 deletions

View File

@ -95,22 +95,17 @@ public extension NvimView {
)
self.api.winGetCursor(window: RxNeovimApi.Window(0))
.map {
guard $0.count == 2
else {
self.log.error("Error decoding \($0)")
return
.flatMapCompletable { cursor in
guard cursor.count == 2 else {
self.log.error("Error decoding \(cursor)")
return Completable.empty()
}
self.api.winSetCursor(
return self.api.winSetCursor(
window: RxNeovimApi.Window(0),
pos: [$0[0] + vertSign * absDeltaY, $0[1] + horizSign * absDeltaX]
pos: [cursor[0] + vertSign * absDeltaY, cursor[1] + horizSign * absDeltaX]
)
.subscribe(onError: { [weak self] error in
self?.log.error("Error in \(#function): \(error)")
})
.disposed(by: self.disposeBag)
}
.subscribe(onFailure: { [weak self] error in
.subscribe(onError: { [weak self] error in
self?.log.error("Error in \(#function): \(error)")
})
.disposed(by: self.disposeBag)

View File

@ -331,7 +331,6 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie
let sourceFileUrls: [URL]
let rpcEventSubscriptionCondition = ConditionVariable()
let nvimExitedCondition = ConditionVariable()
var tabEntries = [TabEntry]()