diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-05-30 07:21:45 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-06-04 02:09:28 +0200 |
commit | d8c7ff13352d7182826b5716ff3b6a66df241231 (patch) | |
tree | d9c451c4933a6fd60683ae2925abd3c2ae34d90d /src/nvim/main.c | |
parent | 1f300e08b8c0c35b2f3d79506ae9817cd8591624 (diff) | |
download | rneovim-d8c7ff13352d7182826b5716ff3b6a66df241231.tar.gz rneovim-d8c7ff13352d7182826b5716ff3b6a66df241231.tar.bz2 rneovim-d8c7ff13352d7182826b5716ff3b6a66df241231.zip |
cleanup, test interactive -E
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 1828d6e6a7..e1a01fdba6 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -300,15 +300,16 @@ int main(int argc, char **argv) // Read user-input if any TTY is connected. // Read ex-commands if invoked with "-es". // - bool reading_input = !headless_mode - && (params.input_isatty || params.output_isatty - || params.err_isatty); - bool reading_excmds = exmode_active == EXMODE_NORMAL; - if (reading_input || reading_excmds) { + bool reading_tty = !headless_mode + && (params.input_isatty || params.output_isatty + || params.err_isatty); + bool reading_excmds = !params.input_isatty && silent_mode + && exmode_active == EXMODE_NORMAL; + if (reading_tty || reading_excmds) { // One of the startup commands (arguments, sourced scripts or plugins) may // prompt the user, so start reading from a tty now. int fd = STDIN_FILENO; - if (!reading_excmds + if (!silent_mode && (!params.input_isatty || params.edit_type == EDIT_STDIN)) { // Use stderr or stdout since stdin is being used to read commands. fd = params.err_isatty ? fileno(stderr) : fileno(stdout); @@ -435,7 +436,7 @@ int main(int argc, char **argv) read_stdin(); } - if (reading_input && (need_wait_return || msg_didany)) { + if (reading_tty && (need_wait_return || msg_didany)) { // Because there's no UI yet, error messages would have been printed to // stdout. Before starting we need confirmation that the user has seen the // messages and that is done with a call to wait_return. @@ -444,7 +445,7 @@ int main(int argc, char **argv) } if (!headless_mode && !silent_mode) { - input_stop(); // Stop reading from input stream. UI will take over. + input_stop(); // Stop reading input, let the UI take over. ui_builtin_start(); } |