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/event | |
| 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/event')
| -rw-r--r-- | src/nvim/event/process.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c index 1a524a56ca..1219566e9b 100644 --- a/src/nvim/event/process.c +++ b/src/nvim/event/process.c @@ -422,7 +422,12 @@ static void exit_event(void **argv) } if (!exiting) { - os_exit(status); + if (ui_client_channel_id) { + os_exit(status); + } else { + assert(status == 0); // Called from rpc_close(), which passes 0 as status. + preserve_exit(NULL); + } } } |