diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-11 18:25:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-11 18:25:01 +0800 |
commit | 7d58de11f49c574a8a305e28e96b9ff810493012 (patch) | |
tree | a3fc6cd9cbb6e689d7f1bd1be776f493ee3802b8 /src/nvim/msgpack_rpc/channel.c | |
parent | 4be6c6cf0ddf5e31d4103cb5df06651ba6f4897b (diff) | |
download | rneovim-7d58de11f49c574a8a305e28e96b9ff810493012.tar.gz rneovim-7d58de11f49c574a8a305e28e96b9ff810493012.tar.bz2 rneovim-7d58de11f49c574a8a305e28e96b9ff810493012.zip |
fix(rpc)!: preseve files when stdio channel is closed (#22137)
BREAKING CHANGE: Unsaved changes are now preserved rather than discarded
when stdio channel is closed.
Diffstat (limited to 'src/nvim/msgpack_rpc/channel.c')
-rw-r--r-- | src/nvim/msgpack_rpc/channel.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 34c8f89e3f..f8be0d4c8d 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -550,6 +550,10 @@ void rpc_close(Channel *channel) if (channel->streamtype == kChannelStreamStdio || (channel->id == ui_client_channel_id && channel->streamtype != kChannelStreamProc)) { + if (channel->streamtype == kChannelStreamStdio) { + // Avoid hanging when there are no other UIs and a prompt is triggered on exit. + remote_ui_disconnect(channel->id); + } exit_from_channel(0); } } |