Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple files in new nvim instance don't open in tabs when using --remote-tab-* #44

Closed
R3load opened this issue Jun 17, 2017 · 4 comments

Comments

@R3load
Copy link

R3load commented Jun 17, 2017

pacman -Q neovim-remote-git:

neovim-remote-git 1.6.1.r0.g53ce66c-1

When spawning a new nvim instance (e.g. in case --servername is invalid) to open multiple files in tabs (via the --remote-tab* options), the buffers open, but not in tabs. Only the first one is shown in the window, the others have to be navigated with :next & :prev.

@mhinz
Copy link
Owner

mhinz commented Jun 19, 2017

Yup, the current fallback is simple: it merely starts a new local process: nvr --remote foo bar -> nvim foo bar.

In a perfect world we would start a new nvim process, with the given servername, and control that one remotely with all the options that were given to nvr.

Not sure if that's as easy as it sounds. We have to start the process in the background, continue running nvr which accesses the new nvim's API, then foreground the process in the end. Not sure how to do that with Python.

I look into it.

@R3load
Copy link
Author

R3load commented Jun 19, 2017

How about forking a delayed nvr --remote-tab to wait for the new nvim instance (wait until the nvim's 'v:servername is readable maybe? the file, not the var, of course), then execute the commandline once it's ready? I know nvim flips after fg, so getting the pid is tricky in bash, I don't know about python though.

mhinz added a commit that referenced this issue Jun 20, 2017
If the given instance is not found, we fork nvr.

The parent process gets replaced by a new nvim instance.

The child waits for one second and then tries attaching to the newly started
nvim instance.

Advantage: All options passed to nvr are now correctly handled even by new nvim
instances that were started by nvr.

References #44
@mhinz
Copy link
Owner

mhinz commented Jun 20, 2017

Please check out the new-nvim-instance branch and see if it works as expected.

Please pull the latest commits and see if it works as expected.

@mhinz mhinz added the solved? label Jun 21, 2017
@mhinz
Copy link
Owner

mhinz commented Jun 23, 2017

It passes all my local tests, so I'm closing this. Please reopen this if there are any issues for you.

And thank you for bringing this up! 🎉

@mhinz mhinz closed this as completed Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants