mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
fix(startup): stop TUI properly when quitting at swap dialog (#25337)
This commit is contained in:
@@ -341,7 +341,7 @@ int main(int argc, char **argv)
|
||||
uint64_t rv = ui_client_start_server(params.argc, params.argv);
|
||||
if (!rv) {
|
||||
os_errmsg("Failed to start Nvim server!\n");
|
||||
getout(1);
|
||||
os_exit(1);
|
||||
}
|
||||
ui_client_channel_id = rv;
|
||||
}
|
||||
@@ -1582,6 +1582,7 @@ static void handle_tag(char *tagname)
|
||||
|
||||
// If the user doesn't want to edit the file then we quit here.
|
||||
if (swap_exists_did_quit) {
|
||||
ui_call_error_exit(1);
|
||||
getout(1);
|
||||
}
|
||||
}
|
||||
@@ -1725,6 +1726,7 @@ static void create_windows(mparm_T *parmp)
|
||||
if (got_int || only_one_window()) {
|
||||
// abort selected or quit and only one window
|
||||
did_emsg = false; // avoid hit-enter prompt
|
||||
ui_call_error_exit(1);
|
||||
getout(1);
|
||||
}
|
||||
// We can't close the window, it would disturb what
|
||||
@@ -1828,6 +1830,7 @@ static void edit_buffers(mparm_T *parmp, char *cwd)
|
||||
if (got_int || only_one_window()) {
|
||||
// abort selected and only one window
|
||||
did_emsg = false; // avoid hit-enter prompt
|
||||
ui_call_error_exit(1);
|
||||
getout(1);
|
||||
}
|
||||
win_close(curwin, true, false);
|
||||
@@ -2238,6 +2241,7 @@ static void usage(void)
|
||||
static void check_swap_exists_action(void)
|
||||
{
|
||||
if (swap_exists_action == SEA_QUIT) {
|
||||
ui_call_error_exit(1);
|
||||
getout(1);
|
||||
}
|
||||
handle_swap_exists(NULL);
|
||||
|
Reference in New Issue
Block a user