From 5943d1b901eb97d542133cf5aac4bb1db3bca1b5 Mon Sep 17 00:00:00 2001 From: George Harker Date: Wed, 15 Nov 2023 12:09:47 -0800 Subject: [PATCH] fix remote rpc commands --- NvimView/Sources/NvimView/NvimView+Resize.swift | 1 + NvimView/Sources/NvimView/NvimView.swift | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/NvimView/Sources/NvimView/NvimView+Resize.swift b/NvimView/Sources/NvimView/NvimView+Resize.swift index 6808e05a..8f3691b4 100644 --- a/NvimView/Sources/NvimView/NvimView+Resize.swift +++ b/NvimView/Sources/NvimView/NvimView+Resize.swift @@ -177,6 +177,7 @@ extension NvimView { ) } ) + .andThen(self.api.subscribe(event: NvimView.rpcEventName)) } ).wait() } diff --git a/NvimView/Sources/NvimView/NvimView.swift b/NvimView/Sources/NvimView/NvimView.swift index 277113b8..d10f3884 100644 --- a/NvimView/Sources/NvimView/NvimView.swift +++ b/NvimView/Sources/NvimView/NvimView.swift @@ -185,6 +185,10 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie case let .notification(method, params): self?.log.debug("NOTIFICATION: \(method): \(params)") + if method == NvimView.rpcEventName { + self?.eventsSubject.onNext(.rpcEvent(params)) + } + if method == "redraw" { self?.renderData(params) } else if method == "autocommand" {