nvim-qt foo.txt
nvim just opens up a new buffer, instead of opening the file.
For reference, I built nvim using fix in #138. I also get these error message when ever I start nvim-qt https://github.com/equalsraf/neovim-qt/issues/146#issuecomment-228262160
Open with nvim-qt -- foo.txt.
Thanks @suy. Is this documented somewhere ? neovim can open files fine even without the --( end of options flag.)
I think it's the usual convention of terminating the options for one app (nvim-qt) and making it pass everything after the -- to the other (nvim).
that seems a bit odd to me. @suy
Why? It's pretty common in Unix. And mentioned in #125 or #106.
I suppose its annoying enough to have popped up in the issue tracker a couple times. I wouldn't mind a patch for this provided that
-- separator is going away to distinguish between options handled by nvim-qt and those handled by nvimi.e. the current CLI arguments and nvim call would change from
nvim-qt [options] [-- ...]
nvim [...]
to this
nvim-qt [options] [filename...] [-- ...]
nvim [...] [filename...]
I'll need to think a bit more about this before starting a PR on it, But some additional toughts or a good PR on the subject would be most welcome.
I'd almost rather have the nvim-qt options be the ones that appear _after_ the --, since most people would expect nvim-qt to be able to be called the same way as nvim or gvim. I'm not sure how difficult that would be to accomplish, though.
Also, even though we can't enumerate all the neovim CLI options/flags, could we enumerate all the ones that neovim-qt parses instead? Then, whatever's left over could be passed to nvim.
I'd almost rather have the nvim-qt options be the ones that appear after the --, since most people would expect nvim-qt to be able to be called the same way as nvim or gvim.
But Neovim itself accepts '--' as a special argument separator i.e. nvim-qt NVIM_QT_ARGS -- NVIM_ARGS_PART1 -- NVIM_ARGS_PART2, which is why we handle it that way.
Also, even though we can't enumerate all the neovim CLI options/flags, could we enumerate all the ones that neovim-qt parses instead? Then, whatever's left over could be passed to nvim.
Some of them could overlap, have the same name (now or in the future), and that is what we need to avoid.
Closing since #155 was merged.
2 years since this was closed, and this is still an issue for me in the most recent version of neovim-qt from releases page — 0.2.9
won't work
nvim-qt file1
nvim-qt -- file1
will actually work
nvim-qt -- -- file1
in other words, double -- delimiter is required.
Hi @edio
2 years since this was closed, and this is still an issue for me in the most recent version of neovim-qt from releases page — 0.2.9
If it does not work it is a regression. It certainly did work when this issue was closed.
In my system (running 0.2.9 from system packages) this case works
$ nvim-qt test.txt
We can inspect the actual command line arguments being used with ps
$ ps -axfww | grep nvim
7422 pts/1 Sl+ 0:00 \_ nvim src/gui/app.cpp
8795 pts/8 S+ 0:00 \_ grep nvim
8777 ? Sl 0:00 /usr/bin/nvim-qt --nofork test2.txt
8779 ? S 0:00 \_ /usr/bin/nvim --embed --headless --cmd let &rtp.=',/usr/share/nvim-qt/runtime' --cmd set termguicolors test2.txt
So the test2.txt filename is used as the last argument in the nvim command.
For -- the result is the same
$ nvim-qt -- test2.txt
$ ps -axfww | grep nvim
7422 pts/1 Sl+ 0:00 \_ nvim src/gui/app.cpp
8875 pts/8 S+ 0:00 \_ grep nvim
8861 ? Sl 0:00 /usr/bin/nvim-qt --nofork -- test2.txt
8863 ? S 0:00 \_ /usr/bin/nvim --embed --headless --cmd let &rtp.=',/usr/share/nvim-qt/runtime' --cmd set termguicolors test2.txt
And with -- -- a double dash is used before the file
$ nvim-qt -- -- test2.txt
$ ps -axfww | grep nvim
7422 pts/1 Sl+ 0:00 \_ nvim src/gui/app.cpp
8977 ? Sl 0:00 /usr/bin/nvim-qt --nofork -- -- test2.txt
8979 ? S 0:00 \_ /usr/bin/nvim --cmd let &rtp.=',/usr/share/nvim-qt/runtime' --cmd set termguicolors --embed --headless -- test2.txt
@edio can you provide some more details about your setup. Are you using any shell alias for nvim-qt? What does ps -axfww | grep nvim produce after starting nvim-qt?
My login shell is zsh, if that matters
[~]$ alias | grep nvim
v='f -e nvim'
vim=nvim
but effect is the same if I set nvim-qt as editor in Krusader.
nvim-qt /tmp/test
8838 ? Sl 0:00 /usr/bin/nvim-qt --nofork /tmp/test
8846 ? S 0:00 \_ /usr/bin/nvim --cmd let &rtp.=',/usr/share' --cmd set termguicolors /tmp/test --embed --headless
nvim-qt -- /tmp/test
9749 ? Sl 0:00 /usr/bin/nvim-qt --nofork -- /tmp/test
9757 ? S 0:00 \_ /usr/bin/nvim --cmd let &rtp.=',/usr/share' --cmd set termguicolors /tmp/test --embed --headless
nvim-qt -- -- /tmp/test
9882 ? Sl 0:00 /usr/bin/nvim-qt --nofork -- -- /tmp/test
9890 ? S 0:00 \_ /usr/bin/nvim --cmd let &rtp.=',/usr/share' --cmd set termguicolors --embed --headless -- /tmp/test
Please let me know, what else may be helpful to investigate this.
Thanks!
Can you build from the source to make a debug build with the following patch?
diff --git a/src/gui/app.cpp b/src/gui/app.cpp
index 2c44260..95fd573 100644
--- a/src/gui/app.cpp
+++ b/src/gui/app.cpp
@@ -241,6 +241,7 @@ NeovimConnector* App::createConnector(const QCommandLineParser& parser)
}
}
+ qDebug() << parser.positionalArguments();
// Pass positional file arguments to Neovim
neovimArgs.append(parser.positionalArguments());
return NeovimQt::NeovimConnector::spawn(neovimArgs, parser.value("nvim"));
It is probably unrelated but the rtp in your command seems wrong in /usr/bin/nvim --cmd let &rtp.=',/usr/share' --cmd set termguicolors /tmp/test --embed --headless it should be something like &rtp.=',/usr/share/nvim-qt/runtime'. How did you install nvim-qt?
On windows I just had to switch to double double dash like @edio
Installed via chocolatey
@equalsraf , I'm sorry I somehow missed the notification and was not aware of your message until today. Will try your patch by the end of this week.
@equalsraf , I instealled neovim-qt using PKGBUILD from AUR (archlinux users repository)
https://aur.archlinux.org/packages/neovim-qt
The PKGBUILD has been updated recently, 8 days ago. And when I tried to install neovim-qt from the new PKGBUILD it worked fine. Here's the PKGBUILD diff if you're interested
https://aur.archlinux.org/cgit/aur.git/commit/?h=neovim-qt&id=fc1ab7334075a647b5bcde05851384967ee5dfcb
I hope this will shed some light on what's going on there and will help investigating the issue @shea-parkes has.
Thanks for spending time on this
This open issue is for Windows, but possibly related: #449.
:+1: @edio that pkgbuild is for 0.2.9, but latest version is 0.2.10. From the diff it seems the previous version was pointing at a staging build so its not clear which version it was there previously.
@shea-parkes you mean the neovim package from chocolatey right?
@equalsraf - Yes. I meant the neovim package from chocolatey. I'm on v0.3.1 (I believe that's current ATM).
I'm happy to post some kind of :checkhealth equivalent for neovim-qt if someone lets me know how to do it. (I'd even then propose a pull request to put it in an issue template...).
@shea-parkes the ideal solution would be to test with the latest neovim-qt, to see if the latest changes fixed this issue. I think the pre-release zip file for neovim should include the correct version https://github.com/neovim/neovim/releases. You should be able to test it without having to remove your current version.
Just found this because I also got 0.3.1 via chocolatey. nvim-qt file doesn't work and after a few weeks it really started to bother me, so I researched why and came here. it's true, with 0.3.1 you need to use nvim-qt -- -- file.
it does work with nvim-qt 0.3.2 win64 though, so at least there this regression seems to be catched here (can't download win32 package: "wasn't found").
just tested it with nvim-qt 0.3.1 win64, also doesn't work
Most helpful comment
2 years since this was closed, and this is still an issue for me in the most recent version of neovim-qt from releases page — 0.2.9
won't work
will actually work
in other words, double
--delimiter is required.