aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/channel.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-10-20 14:27:28 +0200
committerGitHub <noreply@github.com>2021-10-20 14:27:28 +0200
commitf421718d8deb2f36bcbc8fb2f8b4ec9c986aca90 (patch)
treeb409a8a6bce399e8430d6df8ed99c606e1375146 /src/nvim/channel.c
parent035d82e0d3c1c4af09111578e20cf672bd4c432b (diff)
parent9e41e82481753cf13171ab9402bf6f761afc1b66 (diff)
downloadrneovim-f421718d8deb2f36bcbc8fb2f8b4ec9c986aca90.tar.gz
rneovim-f421718d8deb2f36bcbc8fb2f8b4ec9c986aca90.tar.bz2
rneovim-f421718d8deb2f36bcbc8fb2f8b4ec9c986aca90.zip
Merge pull request #16086 from bfredl/termpipe_input
feat(nvim_open_term): support input callback in lua
Diffstat (limited to 'src/nvim/channel.c')
-rw-r--r--src/nvim/channel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/channel.c b/src/nvim/channel.c
index db0a2ff64c..313eefd562 100644
--- a/src/nvim/channel.c
+++ b/src/nvim/channel.c
@@ -8,6 +8,7 @@
#include "nvim/eval/encode.h"
#include "nvim/event/socket.h"
#include "nvim/fileio.h"
+#include "nvim/lua/executor.h"
#include "nvim/msgpack_rpc/channel.h"
#include "nvim/msgpack_rpc/server.h"
#include "nvim/os/shell.h"
@@ -136,6 +137,8 @@ bool channel_close(uint64_t id, ChannelPart part, const char **error)
*error = (const char *)e_invstream;
return false;
}
+ api_free_luaref(chan->stream.internal.cb);
+ chan->stream.internal.cb = LUA_NOREF;
break;
default:
@@ -420,6 +423,7 @@ uint64_t channel_connect(bool tcp, const char *address, bool rpc, CallbackReader
// Create a loopback channel. This avoids deadlock if nvim connects to
// its own named pipe.
channel = channel_alloc(kChannelStreamInternal);
+ channel->stream.internal.cb = LUA_NOREF;
rpc_start(channel);
goto end;
}