diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-12-03 02:44:22 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-06-04 02:07:39 +0200 |
commit | fad748dfface98fa035747b7d2d4402228bae087 (patch) | |
tree | 5ae60e1f3eb2fefab022a281b211082394b0302f /src | |
parent | 488f6ecddad186f4859196b64b5c494e07715ca7 (diff) | |
download | rneovim-fad748dfface98fa035747b7d2d4402228bae087.tar.gz rneovim-fad748dfface98fa035747b7d2d4402228bae087.tar.bz2 rneovim-fad748dfface98fa035747b7d2d4402228bae087.zip |
main.c: remove check_tty(), delayed warning
This code was essentially dead because this condition:
(!parmp->err_isatty && (!parmp->output_isatty || !parmp->input_isatty))
is almost never true.
ref #7659
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/main.c | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index d74bc1a407..1616ba05f8 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -280,7 +280,12 @@ int main(int argc, char **argv) setbuf(stdout, NULL); full_screen = true; - check_tty(¶ms); + + // When starting in Ex mode and commands come from a file, set Silent mode. + // is active input a terminal? + if (!headless_mode && exmode_active && !params.input_isatty) { + silent_mode = true; + } /* * Set the default values for the options that use Rows and Columns. @@ -1392,43 +1397,7 @@ static void handle_tag(char_u *tagname) } } -// Print a warning if stdout is not a terminal. -// When starting in Ex mode and commands come from a file, set Silent mode. -static void check_tty(mparm_T *parmp) -{ - if (headless_mode) { - return; - } - - // is active input a terminal? - if (exmode_active) { - if (!parmp->input_isatty) { - silent_mode = true; - } - } else if (parmp->want_full_screen && (!parmp->err_isatty - && (!parmp->output_isatty || !parmp->input_isatty))) { - - if (!parmp->output_isatty) { - mch_errmsg(_("Vim: Warning: Output is not to a terminal\n")); - } - - if (!parmp->input_isatty) { - mch_errmsg(_("Vim: Warning: Input is not from a terminal\n")); - } - - ui_flush(); - - if (scriptin[0] == NULL) { - os_delay(2000L, true); - } - - TIME_MSG("Warning delay"); - } -} - -/* - * Read text from stdin. - */ +/// Read text from stdin. static void read_stdin(void) { // When getting the ATTENTION prompt here, use a dialog. |