willothy / flatten.nvim

Open files and command output from wezterm, kitty, and neovim terminals in your current neovim instance
https://luarocks.org/modules/willothy/flatten.nvim
MIT License
497 stars 13 forks source link

Conflicts with other embedded nvim instances #41

Closed axieax closed 1 year ago

axieax commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

I'm trying to use plugins such as one-small-step-for-vimkind which spawn an embedded Neovim instance, seemingly conflicting with this plugin. I've filed an issue under that plugin already, and the plugin author suggested asking you for solution to this problem. More context can be found under this issue.

To Reproduce Steps to reproduce the behavior:

  1. Run :lua require'osv'.launch{port=8086}
  2. Error occurs

Expected behavior A clear and concise description of what you expected to happen.

OSV launches and does not return the following error:

E5108: Error executing lua Vim:Error invoking 'nvim_exec_lua' on channel 3:
ch 3 was closed by the client
stack traceback:
        [C]: in function 'rpcrequest'
        ...re/nvim/lazy/one-small-step-for-vimkind/lua/osv/init.lua:134: in function 'launch'
        [string ":lua"]:1: in main chunk

Screenshots If applicable, add screenshots and/or videos to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

willothy commented 1 year ago

I'll work on this today! Wasn't aware there were plugins that made use of nested instances.

The idea I have right now is to add a config option that allows nested instances to open when they aren't launched with any arguments.

Ideally I'd have a way to check if the nested instance was spawned in a terminal or programmatically, but I'm not sure that's possible so I'll add the config option while I'm looking into it.

willothy commented 1 year ago

Should work with the new option enabled, let me know if it doesn't :)

axieax commented 1 year ago

Thanks, works like a charm now! Just wondering why this isn't the default option? Will there be other potential side effects?

willothy commented 1 year ago

It's not the default because I want to minimize breaking changes for configs, but I may make it a default in the future. Glad it works!