startup: fix stall issue with -D options (#12652)

fixes #12647.
This commit is contained in:
erw7
2020-07-20 00:44:22 +09:00
committed by GitHub
parent 08efa7037e
commit 8e350c1c69
2 changed files with 45 additions and 19 deletions

View File

@@ -313,6 +313,26 @@ int main(int argc, char **argv)
input_start(STDIN_FILENO);
}
// Wait for UIs to set up Nvim or show early messages
// and prompts (--cmd, swapfile dialog, …).
bool use_remote_ui = (embedded_mode && !headless_mode);
bool use_builtin_ui = (!headless_mode && !embedded_mode && !silent_mode);
if (use_remote_ui || use_builtin_ui) {
TIME_MSG("waiting for UI");
if (use_remote_ui) {
remote_ui_wait_for_attach();
} else {
ui_builtin_start();
}
TIME_MSG("done waiting for UI");
// prepare screen now, so external UIs can display messages
starting = NO_BUFFERS;
screenclear();
TIME_MSG("initialized screen early for UI");
}
// open terminals when opening files that start with term://
#define PROTO "term://"
do_cmdline_cmd("augroup nvim_terminal");
@@ -335,25 +355,6 @@ int main(int argc, char **argv)
p_lpl = false;
}
// Wait for UIs to set up Nvim or show early messages
// and prompts (--cmd, swapfile dialog, …).
bool use_remote_ui = (embedded_mode && !headless_mode);
bool use_builtin_ui = (!headless_mode && !embedded_mode && !silent_mode);
if (use_remote_ui || use_builtin_ui) {
TIME_MSG("waiting for UI");
if (use_remote_ui) {
remote_ui_wait_for_attach();
} else {
ui_builtin_start();
}
TIME_MSG("done waiting for UI");
// prepare screen now, so external UIs can display messages
starting = NO_BUFFERS;
screenclear();
TIME_MSG("initialized screen early for UI");
}
// Execute --cmd arguments.
exe_pre_commands(&params);