aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-08-21 07:58:51 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-08-21 13:28:53 -0300
commitcb87670ff819161fb6ab70790d00ab87fc965aa7 (patch)
treeffa61c462855c877f0a9461f3e5f45d5f21b4583 /src/nvim/main.c
parent1beee0685d33adf15457927b2487e8f89da178a0 (diff)
downloadrneovim-cb87670ff819161fb6ab70790d00ab87fc965aa7.tar.gz
rneovim-cb87670ff819161fb6ab70790d00ab87fc965aa7.tar.bz2
rneovim-cb87670ff819161fb6ab70790d00ab87fc965aa7.zip
main: Initialize event loop before command_line_scan
The call to `event_init()` was too late. `command_line_scan()` in `main()` could already need the loop initialized. Ref https://github.com/neovim/neovim/issues/3045#issuecomment-123405833. A consequence of this change is that it was necessary to move the `channel_from_stdio()` call to `command_line_scan()` when embedded_mode is set.
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index e11db16c61..9af15924bd 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -245,6 +245,7 @@ int main(int argc, char **argv)
set_vim_var_string(VV_PROGPATH, (char_u *)argv[0], -1);
set_vim_var_string(VV_PROGNAME, path_tail((char_u *)argv[0]), -1);
+ event_init();
/*
* Process the command line arguments. File names are put in the global
* argument list "global_alist".
@@ -275,7 +276,6 @@ int main(int argc, char **argv)
if (GARGCOUNT > 1 && !silent_mode)
printf(_("%d files to edit\n"), GARGCOUNT);
- event_init();
full_screen = true;
t_colors = 256;
check_tty(&params);
@@ -963,6 +963,7 @@ static void command_line_scan(mparm_T *parmp)
} else if (STRICMP(argv[0] + argv_idx, "embed") == 0) {
embedded_mode = true;
parmp->headless = true;
+ channel_from_stdio();
} else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0) {
#if !defined(UNIX)
parmp->literal = TRUE;