diff --git a/NvimServer b/NvimServer index d3ed5e58..9dda8da8 160000 --- a/NvimServer +++ b/NvimServer @@ -1 +1 @@ -Subproject commit d3ed5e58b291b531ed31c5e827479127c525004e +Subproject commit 9dda8da89a7bcbaab138127a855efaedeea0b2c0 diff --git a/RxPack/Sources/RxPack/RxNeovimApi.generated.swift b/RxPack/Sources/RxPack/RxNeovimApi.generated.swift index 0fec0bd3..226a4ced 100644 --- a/RxPack/Sources/RxPack/RxNeovimApi.generated.swift +++ b/RxPack/Sources/RxPack/RxNeovimApi.generated.swift @@ -201,6 +201,38 @@ extension RxNeovimApi { .asCompletable() } + public func bufSetText( + buffer: RxNeovimApi.Buffer, + start_row: Int, + start_col: Int, + end_row: Int, + end_col: Int, + replacement: [String], + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .int(Int64(buffer.handle)), + .int(Int64(start_row)), + .int(Int64(start_col)), + .int(Int64(end_row)), + .int(Int64(end_col)), + .array(replacement.map { .string($0) }), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_buf_set_text", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_buf_set_text", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + public func bufGetOffset( buffer: RxNeovimApi.Buffer, index: Int, @@ -1732,6 +1764,40 @@ extension RxNeovimApi { .map(transform) } + public func notify( + msg: String, + log_level: Int, + opts: Dictionary, + errWhenBlocked: Bool = true + ) -> Single { + + let params: [RxNeovimApi.Value] = [ + .string(msg), + .int(Int64(log_level)), + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + func transform(_ value: Value) throws -> RxNeovimApi.Value { + guard let result = (Optional(value)) else { + throw RxNeovimApi.Error.conversion(type: RxNeovimApi.Value.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_notify", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_notify", params: params, expectsReturnValue: true) + .map(transform) + } + public func callFunction( fn: String, args: RxNeovimApi.Value, @@ -2226,6 +2292,32 @@ extension RxNeovimApi { .asCompletable() } + public func echo( + chunks: RxNeovimApi.Value, + history: Bool, + opts: Dictionary, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + chunks, + .bool(history), + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_echo", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_echo", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + public func outWrite( str: String, expectsReturnValue: Bool = false