Skip to content

Commit

Permalink
refactor(main.c): remove unreachable use_builtin_ui conditions (neovi…
Browse files Browse the repository at this point in the history
…m#22338)

When use_builtin_ui is true, Nvim will exit before line 385 is reached.
  • Loading branch information
zeertzjq authored Feb 20, 2023
1 parent b62c0c8 commit f1816f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion runtime/doc/eval.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,7 @@ v:event Dictionary of event data for the current |autocommand|. Valid
abort Whether the event triggered during
an aborting condition (e.g. |c_Esc| or
|c_CTRL-C| for |CmdlineLeave|).
chan |channel-id| or 0 for "internal".
chan |channel-id|
cmdlevel Level of cmdline.
cmdtype Type of cmdline, |cmdline-char|.
cwd Current working directory.
Expand Down
7 changes: 4 additions & 3 deletions src/nvim/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ int main(int argc, char **argv)
if (ui_client_channel_id) {
ui_client_run(remote_ui); // NORETURN
}
assert(!ui_client_channel_id && !use_builtin_ui);

// Wait for UIs to set up Nvim or show early messages
// and prompts (--cmd, swapfile dialog, …).
Expand Down Expand Up @@ -583,13 +584,13 @@ int main(int argc, char **argv)
set_vim_var_nr(VV_VIM_DID_ENTER, 1L);
apply_autocmds(EVENT_VIMENTER, NULL, NULL, false, curbuf);
TIME_MSG("VimEnter autocommands");
if (use_remote_ui || use_builtin_ui) {
do_autocmd_uienter(use_remote_ui ? CHAN_STDIO : 0, true);
if (use_remote_ui) {
do_autocmd_uienter(CHAN_STDIO, true);
TIME_MSG("UIEnter autocommands");
}

#ifdef MSWIN
if (use_remote_ui || use_builtin_ui) {
if (use_remote_ui) {
os_icon_init();
}
os_title_save();
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/tui/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static void tinput_wait_enqueue(void **argv)
input->paste = 2;
}
rbuffer_reset(input->key_buffer);
} else { // enqueue input for the main thread or Nvim server
} else { // enqueue input
RBUFFER_UNTIL_EMPTY(input->key_buffer, buf, len) {
const String keys = { .data = buf, .size = len };
MAXSIZE_TEMP_ARRAY(args, 1);
Expand Down

0 comments on commit f1816f9

Please sign in to comment.
  NODES
COMMUNITY 1
INTERN 1
Note 1
Project 3
USERS 1