From b2ad7eb0b705f6d5e0c4f9a916e241e553a5b57f Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 19 Jan 2020 20:40:32 +0100 Subject: [PATCH] Update neovim --- .../NvimAutoCommandEvent.generated.swift | 27 ++++++------ NvimView/neovim | 2 +- RxPack/RxNeovimApi.generated.swift | 42 ++++++++++++++++--- 3 files changed, 51 insertions(+), 20 deletions(-) diff --git a/NvimView/NvimView/NvimAutoCommandEvent.generated.swift b/NvimView/NvimView/NvimAutoCommandEvent.generated.swift index dec164ca..498881d3 100644 --- a/NvimView/NvimView/NvimAutoCommandEvent.generated.swift +++ b/NvimView/NvimView/NvimAutoCommandEvent.generated.swift @@ -1,5 +1,5 @@ -// Auto generated for nvim v0.5.0-dev. -// See bin/generate_autocmds.py +// Auto generated for nvim v0.5.0-dev +// See bin/generate_autocmds.sh enum NvimAutoCommandEvent: Int { @@ -24,12 +24,12 @@ enum NvimAutoCommandEvent: Int { case bufwritepre = 18 case chaninfo = 19 case chanopen = 20 - case cmdlinechanged = 21 - case cmdlineenter = 22 - case cmdlineleave = 23 - case cmdundefined = 24 - case cmdwinenter = 25 - case cmdwinleave = 26 + case cmdundefined = 21 + case cmdwinenter = 22 + case cmdwinleave = 23 + case cmdlinechanged = 24 + case cmdlineenter = 25 + case cmdlineleave = 26 case colorscheme = 27 case colorschemepre = 28 case completechanged = 29 @@ -79,8 +79,8 @@ enum NvimAutoCommandEvent: Int { case shellfilterpost = 73 case signal = 74 case sourcecmd = 75 - case sourcepre = 76 - case sourcepost = 77 + case sourcepost = 76 + case sourcepre = 77 case spellfilemissing = 78 case stdinreadpost = 79 case stdinreadpre = 80 @@ -110,7 +110,8 @@ enum NvimAutoCommandEvent: Int { case vimresized = 104 case vimresume = 105 case vimsuspend = 106 - case winenter = 107 - case winleave = 108 - case winnew = 109 + case winclosed = 107 + case winenter = 108 + case winleave = 109 + case winnew = 110 } diff --git a/NvimView/neovim b/NvimView/neovim index 9f1ed736..0098c840 160000 --- a/NvimView/neovim +++ b/NvimView/neovim @@ -1 +1 @@ -Subproject commit 9f1ed7368419bf7c84556d74bf7f4f47a0c50481 +Subproject commit 0098c8405a1d062a15452c20ef6af243b7d9d0be diff --git a/RxPack/RxNeovimApi.generated.swift b/RxPack/RxNeovimApi.generated.swift index 026444f5..c5f5069f 100644 --- a/RxPack/RxNeovimApi.generated.swift +++ b/RxPack/RxNeovimApi.generated.swift @@ -824,7 +824,7 @@ extension RxNeovimApi { func bufAddHighlight( buffer: RxNeovimApi.Buffer, - ns_id: Int, + src_id: Int, hl_group: String, line: Int, col_start: Int, @@ -834,7 +834,7 @@ extension RxNeovimApi { let params: [RxNeovimApi.Value] = [ .int(Int64(buffer.handle)), - .int(Int64(ns_id)), + .int(Int64(src_id)), .string(hl_group), .int(Int64(line)), .int(Int64(col_start)), @@ -922,7 +922,7 @@ extension RxNeovimApi { func bufSetVirtualText( buffer: RxNeovimApi.Buffer, - ns_id: Int, + src_id: Int, line: Int, chunks: RxNeovimApi.Value, opts: Dictionary, @@ -931,7 +931,7 @@ extension RxNeovimApi { let params: [RxNeovimApi.Value] = [ .int(Int64(buffer.handle)), - .int(Int64(ns_id)), + .int(Int64(src_id)), .int(Int64(line)), chunks, .map(opts.mapToDict({ (Value.string($0), $1) })), @@ -960,13 +960,13 @@ extension RxNeovimApi { func bufGetVirtualText( buffer: RxNeovimApi.Buffer, - lnum: Int, + line: Int, checkBlocked: Bool = true ) -> Single { let params: [RxNeovimApi.Value] = [ .int(Int64(buffer.handle)), - .int(Int64(lnum)), + .int(Int64(line)), ] func transform(_ value: Value) throws -> RxNeovimApi.Value { @@ -1462,6 +1462,36 @@ extension RxNeovimApi { .map(transform) } + func getHlIdByName( + name: String, + checkBlocked: Bool = true + ) -> Single { + + let params: [RxNeovimApi.Value] = [ + .string(name), + ] + + func transform(_ value: Value) throws -> Int { + guard let result = ((value.integerValue == nil ? nil : Int(value.integerValue!))) else { + throw RxNeovimApi.Error.conversion(type: Int.self) + } + + return result + } + + if checkBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_get_hl_id_by_name", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_get_hl_id_by_name", params: params, expectsReturnValue: true) + .map(transform) + } + func feedkeys( keys: String, mode: String,