From 5c632d524816b6c5511b563395fcc7b352e9b7b6 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Mon, 24 Jan 2022 16:35:01 +0100 Subject: [PATCH] Update neovim --- NvimServer | 2 +- .../NvimAutoCommandEvent.generated.swift | 98 ++++++----- .../NvimCursorModeShape.generated.swift | 2 +- .../RxPack/RxNeovimApi.generated.swift | 164 +++++++++++++++++- RxPack/nvim-version.txt | 2 +- 5 files changed, 215 insertions(+), 53 deletions(-) diff --git a/NvimServer b/NvimServer index c4098c51..10968e29 160000 --- a/NvimServer +++ b/NvimServer @@ -1 +1 @@ -Subproject commit c4098c5114d0ad9428458bc79293646bc4a41865 +Subproject commit 10968e2931a2388ca6476d7eb37c2af95b83af1b diff --git a/NvimView/Sources/NvimView/NvimAutoCommandEvent.generated.swift b/NvimView/Sources/NvimView/NvimAutoCommandEvent.generated.swift index cf275ca1..80d0f64b 100644 --- a/NvimView/Sources/NvimView/NvimAutoCommandEvent.generated.swift +++ b/NvimView/Sources/NvimView/NvimAutoCommandEvent.generated.swift @@ -1,4 +1,4 @@ -// Auto generated for nvim v0.6.1 +// Auto generated for nvim v0.7.0-dev // See bin/generate_autocmds.py enum NvimAutoCommandEvent: Int { @@ -73,51 +73,55 @@ enum NvimAutoCommandEvent: Int { case insertleave = 67 case insertleavepre = 68 case menupopup = 69 - case optionset = 70 - case quickfixcmdpost = 71 - case quickfixcmdpre = 72 - case quitpre = 73 - case remotereply = 74 - case sessionloadpost = 75 - case shellcmdpost = 76 - case shellfilterpost = 77 - case signal = 78 - case sourcecmd = 79 - case sourcepost = 80 - case sourcepre = 81 - case spellfilemissing = 82 - case stdinreadpost = 83 - case stdinreadpre = 84 - case swapexists = 85 - case syntax = 86 - case tabclosed = 87 - case tabenter = 88 - case tableave = 89 - case tabnew = 90 - case tabnewentered = 91 - case termchanged = 92 - case termclose = 93 - case termenter = 94 - case termleave = 95 - case termopen = 96 - case termresponse = 97 - case textchanged = 98 - case textchangedi = 99 - case textchangedp = 100 - case textyankpost = 101 - case uienter = 102 - case uileave = 103 - case user = 104 - case vimenter = 105 - case vimleave = 106 - case vimleavepre = 107 - case vimresized = 108 - case vimresume = 109 - case vimsuspend = 110 - case winclosed = 111 - case winenter = 112 - case winleave = 113 - case winnew = 114 - case winscrolled = 115 + case modechanged = 70 + case optionset = 71 + case quickfixcmdpost = 72 + case quickfixcmdpre = 73 + case quitpre = 74 + case recordingenter = 75 + case recordingleave = 76 + case remotereply = 77 + case searchwrapped = 78 + case sessionloadpost = 79 + case shellcmdpost = 80 + case shellfilterpost = 81 + case signal = 82 + case sourcecmd = 83 + case sourcepost = 84 + case sourcepre = 85 + case spellfilemissing = 86 + case stdinreadpost = 87 + case stdinreadpre = 88 + case swapexists = 89 + case syntax = 90 + case tabclosed = 91 + case tabenter = 92 + case tableave = 93 + case tabnew = 94 + case tabnewentered = 95 + case termchanged = 96 + case termclose = 97 + case termenter = 98 + case termleave = 99 + case termopen = 100 + case termresponse = 101 + case textchanged = 102 + case textchangedi = 103 + case textchangedp = 104 + case textyankpost = 105 + case uienter = 106 + case uileave = 107 + case user = 108 + case vimenter = 109 + case vimleave = 110 + case vimleavepre = 111 + case vimresized = 112 + case vimresume = 113 + case vimsuspend = 114 + case winclosed = 115 + case winenter = 116 + case winleave = 117 + case winnew = 118 + case winscrolled = 119 } diff --git a/NvimView/Sources/NvimView/NvimCursorModeShape.generated.swift b/NvimView/Sources/NvimView/NvimCursorModeShape.generated.swift index fb67a2d6..5635e9da 100644 --- a/NvimView/Sources/NvimView/NvimCursorModeShape.generated.swift +++ b/NvimView/Sources/NvimView/NvimCursorModeShape.generated.swift @@ -1,4 +1,4 @@ -// Auto generated for nvim v0.6.1 +// Auto generated for nvim v0.7.0-dev // See bin/generate_cursor_shape.py public enum CursorModeShape: UInt { diff --git a/RxPack/Sources/RxPack/RxNeovimApi.generated.swift b/RxPack/Sources/RxPack/RxNeovimApi.generated.swift index b0ead96a..370803d7 100644 --- a/RxPack/Sources/RxPack/RxNeovimApi.generated.swift +++ b/RxPack/Sources/RxPack/RxNeovimApi.generated.swift @@ -1,4 +1,4 @@ -// Auto generated for nvim version 0.6.1. +// Auto generated for nvim version 0.7.0. // See bin/generate_api_methods.py import Foundation @@ -827,6 +827,58 @@ extension RxNeovimApi { .map(transform) } + public func bufAddUserCommand( + buffer: RxNeovimApi.Buffer, + name: String, + command: RxNeovimApi.Value, + opts: Dictionary, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .int(Int64(buffer.handle)), + .string(name), + command, + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_buf_add_user_command", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_buf_add_user_command", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + + public func bufDelUserCommand( + buffer: RxNeovimApi.Buffer, + name: String, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .int(Int64(buffer.handle)), + .string(name), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_buf_del_user_command", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_buf_del_user_command", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + public func createNamespace( name: String, errWhenBlocked: Bool = true @@ -1620,14 +1672,14 @@ extension RxNeovimApi { public func feedkeys( keys: String, mode: String, - escape_csi: Bool, + escape_ks: Bool, expectsReturnValue: Bool = false ) -> Completable { let params: [RxNeovimApi.Value] = [ .string(keys), .string(mode), - .bool(escape_csi), + .bool(escape_ks), ] if expectsReturnValue { @@ -2152,6 +2204,64 @@ extension RxNeovimApi { .map(transform) } + public func getOptionValue( + name: String, + opts: Dictionary, + errWhenBlocked: Bool = true + ) -> Single { + + let params: [RxNeovimApi.Value] = [ + .string(name), + .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_get_option_value", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_get_option_value", params: params, expectsReturnValue: true) + .map(transform) + } + + public func setOptionValue( + name: String, + value: RxNeovimApi.Value, + opts: Dictionary, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .string(name), + value, + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_set_option_value", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_set_option_value", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + public func getAllOptionsInfo( errWhenBlocked: Bool = true ) -> Single> { @@ -3368,6 +3478,54 @@ extension RxNeovimApi { .map(transform) } + public func addUserCommand( + name: String, + command: RxNeovimApi.Value, + opts: Dictionary, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .string(name), + command, + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_add_user_command", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_add_user_command", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + + public func delUserCommand( + name: String, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .string(name), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_del_user_command", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_del_user_command", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + public func exec( src: String, output: Bool, diff --git a/RxPack/nvim-version.txt b/RxPack/nvim-version.txt index 14909610..bf867e0a 100644 --- a/RxPack/nvim-version.txt +++ b/RxPack/nvim-version.txt @@ -1 +1 @@ -v0.6.1 +nightly