I launch neovim-qt via this zsh function:
function gvim {
nvim-qt --geometry 970x512 --no-ext-tabline -- "$@" &
}
I updated to neovim 0.3.0 and when calling the above, I get a window to open just fine but there are two buffers: an empty one and another buffer the one with the file.

Just for completeness sake. When I select the second buffer, the one where my file is, this is what I get:

@equalsraf Are you still looking at these? A while back you were very quick at replying and now I have two bugs reported and have heard nothing? You okay? You still maintaining this? …
hi @kierun I'm good, just crazy busy :) thanks for asking.
As for the issue. I was able to reproduce this in sh too. And I confirmed it does not happen with neovim alone. To replicate is enough to call nvim-qt with a single file name argument (the file does not need to exist) i.e.
bin/nvim-qt --nvim ../../neovim/build/bin/nvim -- -u NONE /tmp/test
However this does not cause the same issue
../../neovim/build/bin/nvim -u NONE /tmp/test
The additional buffer is unnamed which suggests this is not a bug regarding command line arguments.
On a side note you can probably remove the & since nvim-qt now forks into the backgroud.
hi @kierun I'm good, just crazy busy :) thanks for asking.
You're welcome.
As for the issue. I was able to reproduce this in sh too.
Right, so not the shell… Good.
On a side note you can probably remove the & since nvim-qt now forks into the background.
Yup. Done that, all working. Thanks.
FWIW, until this bug is fixed you can kill the extra empty buffer by putting this init.vim
if @% == ""
bd
endif
I wouldn't expect nvim-qt to be affected by this, but https://github.com/neovim/neovim/pull/8576 may help with this. If not I don't know what the issue could be. Can someone try that PR?
@JAffleck
Even better, just add it to ~/.config/nvim/ginit.vim…
Sorry, pressed the wrong key…
I managed to fix this (for me) with this extremely simple patch. It seems that for whatever reason the current version neovim doesn't like getting option paramaters passed after files. Neovim-qt was passing arguments that look like --cmd let &rtp.=',/usr/local/share/nvim-qt/runtime' --cmd set termguicolors *FILES* --embed --headless. There are two simple solutions. The first is to define an alias like alias gvi='nvim-qt --no-ext-tabline -- --' which forces nvim-qt to put its arguments before the file list. The second and better solution is to force nvim-qt to always put its arguments before the file list. This patch does that.
diff --git a/src/neovimconnector.cpp b/src/neovimconnector.cpp
index 1f15768..1ba4f4c 100644
--- a/src/neovimconnector.cpp
+++ b/src/neovimconnector.cpp
@@ -196,8 +196,8 @@ NeovimConnector* NeovimConnector::spawn(const QStringList& params, const QString
QProcess *p = new QProcess();
QStringList args;
if (params.indexOf("--") == -1) {
- args.append(params);
args << "--embed" << "--headless";
+ args.append(params);
} else {
// Neovim accepts a -- argument after which only
// filenames are passed
I'm not sure if it's worth opening a pull request for something this small but this does fix the problem.
@roflcopter4 I just tried your patch and can confirm that this solves the issue. Thank you.
Thanks @roflcopter4 that fixes it.
Totally missed that one, but it does make sense, although I would only expect this to happen when -- was in use.
I tried to reproduce this in standalone nvim with other cli options but failed. Maybe this only happens when --embed is in effect.
I'm not sure if it's worth opening a pull request for something this small but this does fix the problem.
Please do, I'll be happy to just press the merge button.
This issue still remains on windows, neovim 0.3.1
@DrakeXiang this should be fixed in master.
@equalsraf I've tested right now the latest nightly build (https://github.com/neovim/neovim/commit/5f15788dc3ac1ea7906673eacc9cf9bdb1f14212 ) under Windows 10 and it still doesn't work (one has to close the buffer with :bd to get the expected result).
@dumblob can you try the artifact from https://github.com/neovim/neovim/pull/8901 . It works when I tested it.
@justinmk great, it works now for me with the artifact. Thanks.
I tested with the latest nightly and this issue doesn't occur anymore.
thanks!
Ok closing this, thanks for checking.
Most helpful comment
I managed to fix this (for me) with this extremely simple patch. It seems that for whatever reason the current version neovim doesn't like getting option paramaters passed after files. Neovim-qt was passing arguments that look like
--cmd let &rtp.=',/usr/local/share/nvim-qt/runtime' --cmd set termguicolors *FILES* --embed --headless. There are two simple solutions. The first is to define an alias likealias gvi='nvim-qt --no-ext-tabline -- --'which forces nvim-qt to put its arguments before the file list. The second and better solution is to force nvim-qt to always put its arguments before the file list. This patch does that.I'm not sure if it's worth opening a pull request for something this small but this does fix the problem.