diff options
-rw-r--r-- | src/nvim/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 79c165419e..025312a6e1 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1414,7 +1414,10 @@ static void read_stdin(void) no_wait_return = true; int save_msg_didany = msg_didany; set_buflisted(true); - (void)open_buffer(true, NULL, 0); // create memfile and read file + + // Create memfile and read from stdin. + (void)open_buffer(true, NULL, 0); + if (BUFEMPTY() && curbuf->b_next != NULL) { // stdin was empty, go to buffer 2 (e.g. "echo file1 | xargs nvim"). #8561 do_cmdline_cmd("silent! bnext"); |