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

Not compatible with Oni #262

Closed
brglng opened this issue Mar 13, 2018 · 8 comments
Closed

Not compatible with Oni #262

brglng opened this issue Mar 13, 2018 · 8 comments

Comments

@brglng
Copy link

brglng commented Mar 13, 2018

Problems summary

Dein is not compatible with Oni because of the caching of runtimepath. dein#load_state() overwrites the entire runtimepath, which also contains the runtime paths added by Oni, which are essential for Oni to behave correctly. If I run nvim once before running oni, then the runtimepath will be overwritten to the runtimepath when I previously run nvim, and that causes problems in Oni.

Expected

There should be some mechanisms to deal with such problems, as many GUIs may add their own runtimepaths. But I cannot imagine a good way to solve this at the moment.

Environment Information (Required!)

  • dein.vim version(SHA1): 5bbff63
  • OS: Ubuntu 17.10
  • Vim/neovim version: Neovim v0.2.2

Provide a minimal .vimrc with less than 50 lines (Required!)

set runtimepath+=$HOME/.local/share/dein/repos/github.com/Shougo/dein.vim

let g:dein#install_process_timeout = 3600 * 2

if dein#load_state($HOME . '/.local/share/dein')
  call dein#begin($HOME . '/.local/share/dein')

  call dein#add($HOME . '/.local/share/dein/repos/github.com/Shougo/dein.vim')

  " Required:
  call dein#end()
  call dein#save_state()
endif

The reproduce ways from Vim starting (Required!)

There must be "oni.loadInitVim": true in Oni's config (~/.oni/config.js).

Method 1:

  1. Install Dein and plugins in nvim.
  2. Open Oni
  3. Check if Oni behaves correctly (With some specific settings, Oni can crash when using :q to exit, but I cannot figure out what setting caused that. But if I call dein#clear_state() and restart Oni, it works with no problem.)

Method 2:

  1. Install Dein and plugins in nvim.
  2. Manually clears Dein's state files.
  3. Start Oni and it should work correctly.
  4. Exit Oni and start nvim, you should see nvim continuously reports no notification handler registered for "oni_plugin_notify" error. That is because Dein has loaded the runtimepath cache when using Oni before, which does not work in nvim.

Screen shot (if possible)

Upload the log messages by :redir and :message (if errored)

@Shougo
Copy link
Owner

Shougo commented Mar 14, 2018

Hm. It is not dein problem.
dein uses fnamemodify(v:progname, ':r') as the state name.
I think it is same with oni and normal nvim.
So it will be overwritten.

@Shougo
Copy link
Owner

Shougo commented Mar 14, 2018

If oni can tell dein the GUI client name.
I can add the support for it.

@Shougo
Copy link
Owner

Shougo commented Mar 14, 2018

I think you should not share the dein cache directory between normal neovim and Oni.

@brglng
Copy link
Author

brglng commented Mar 14, 2018

Hmm... It looks like in Oni v:progname is nvim, which caused problem.

@Shougo
Copy link
Owner

Shougo commented Mar 14, 2018

If plugin can check neovim --headless mode, it can be fixed.

@Shougo
Copy link
Owner

Shougo commented Mar 14, 2018

@Shougo
Copy link
Owner

Shougo commented Mar 14, 2018

dein should check runtimepath in cache loading.

@brglng
Copy link
Author

brglng commented Mar 19, 2018

Thank you very much! The fix works great!

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