startup: stdin-text with -E, -Es (improved Ex-mode)

Special-case for -E/-Es (as opposed to -e/-es).

-es/-Es is the only mode that really allows N/Vim to work as a batch
script engine.  Adding a new flag (say `-x`) would involve a lot of
churn: -es/-Es is implemented by checking `exmode_active` in numerous
places.

This commit does not change -es because some scripts use it. But scripts
are unlikely to use -Es because it is not functionally different from
-es.

Also, both -es and -Es were broken in Nvim for years and no one
mentioned it...
This commit is contained in:
Justin M. Keyes 2018-05-23 02:28:31 +02:00
parent 905d4d78fc
commit 4b70ebe013

View File

@ -729,7 +729,7 @@ static bool edit_stdin(mparm_T *parmp)
{
return !headless_mode
&& !embedded_mode
&& !exmode_active // `-es` was not given.
&& exmode_active != EXMODE_NORMAL // -E/-Es but not -e/-es.
&& !parmp->input_isatty
&& scriptin[0] == NULL; // `-s -` was not given.
}