1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-18 19:21:39 +03:00

Update neovim

This commit is contained in:
Tae Won Ha 2022-05-01 17:57:03 +02:00
parent 61dc2d759a
commit 09017be848
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 33 additions and 1 deletions

@ -1 +1 @@
Subproject commit 6e1c95175628d8519ab62367be5617342f43aff0 Subproject commit fd3386c85450837abbfcbffe3d4246e4a5a28478

View File

@ -3772,6 +3772,38 @@ extension RxNeovimApi {
.asCompletable() .asCompletable()
} }
public func parseCmd(
str: String,
opts: Dictionary<String, RxNeovimApi.Value>,
errWhenBlocked: Bool = true
) -> Single<Dictionary<String, RxNeovimApi.Value>> {
let params: [RxNeovimApi.Value] = [
.string(str),
.map(opts.mapToDict({ (Value.string($0), $1) })),
]
func transform(_ value: Value) throws -> Dictionary<String, RxNeovimApi.Value> {
guard let result = (msgPackDictToSwift(value.dictionaryValue)) else {
throw RxNeovimApi.Error.conversion(type: Dictionary<String, RxNeovimApi.Value>.self)
}
return result
}
if errWhenBlocked {
return self
.checkBlocked(
self.rpc(method: "nvim_parse_cmd", params: params, expectsReturnValue: true)
)
.map(transform)
}
return self
.rpc(method: "nvim_parse_cmd", params: params, expectsReturnValue: true)
.map(transform)
}
public func exec( public func exec(
src: String, src: String,
output: Bool, output: Bool,