diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-06-17 14:22:02 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-06-17 14:50:53 +0200 |
commit | 487cf98c0b61ade023fc71d945a64e61f8374eac (patch) | |
tree | 165ff97f2e0f2f0944af1dc37bfec6bdf71794b3 /src | |
parent | 9c2099d5850a6a434f7269913d316d57da1362e2 (diff) | |
download | rneovim-487cf98c0b61ade023fc71d945a64e61f8374eac.tar.gz rneovim-487cf98c0b61ade023fc71d945a64e61f8374eac.tar.bz2 rneovim-487cf98c0b61ade023fc71d945a64e61f8374eac.zip |
startup: fix -E/-Es without `-u NONE`
Before this change, -E/-Es without `-u NONE` reads stdin as Ex commands.
It should always read stdin as text (into buffer 1), like this:
echo foo | nvim -Es +'%p'
foo
echo foo | nvim -Es -u NORC +'%p'
foo
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 7296d9a7de..ea43b93b30 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -301,9 +301,11 @@ int main(int argc, char **argv) // Read ex-commands if invoked with "-es". // bool reading_tty = !headless_mode + && !silent_mode && (params.input_isatty || params.output_isatty || params.err_isatty); - bool reading_excmds = !params.input_isatty && silent_mode + 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 |