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

vim-symlink fails with 'autocmd nesting too deep' when opening help files with a symlinked config directory #6

Open
andrewferrier opened this issue Apr 20, 2020 · 2 comments

Comments

@andrewferrier
Copy link

Thanks for all your hard work on this great plugin! Unfortunately, I've found an annoying corner case which I've hit which affects my usage of help files.

Recreation steps:

  • Use Neovim 0.4.3 (I suspect this will happen with other versions and regular Vim also, but I haven't tested).

  • Remove ~/.config/nvim if exists. Create a directory elsewhere (e.g. /tmp/test and symlink - cd ~/.config && ln -s /tmp/test nvim.

  • Copy the contents of this file into ~/.config/nvim as init.vim:

echom system('git clone https://github.com/kristijanhusak/vim-packager ' . $HOME . '/.config/nvim/pack/packager/opt/vim-packager')

packadd vim-packager
call packager#init()
call packager#add('kristijanhusak/vim-packager', { 'type': 'opt' })
call packager#add('moll/vim-bbye') " needed for vim-symlink
call packager#add('junegunn/fzf', { 'do': './install --bin' })
call packager#add('junegunn/fzf.vim')
call packager#add('aymericbeaumet/vim-symlink')
call packager#install()
  • Load neovim and wait for package installation to complete. Quit and restart. Ignore error about existing directory, I don't think it's relevant.

  • Type :help fzf. Expect that help loads. Instead see errors like this:

Error detected while processing function <SNR>29_on_buf_read[11]..<SNR>28_bdelete:
line   27:
E218: autocommand nesting too deep
E218: autocommand nesting too deep
E218: autocommand nesting too deep
Error detected while processing function <SNR>29_on_buf_read:
line   11:
E171: Missing :endif

Some observations:

  • I have created the above minimal setup to provide easier recreation; this happens with my full Neovim init.vim and other config also (I know the symlink is a bit unusual but I keep my config under source control so have symlinked it to elsewhere). I don't think it's that uncommon ;)

  • I don't think the fact that it's FZF is relevant; it appears this happens with any help file installed in ~/.config/nvim/pack.

  • It does not happen if ~/.config/nvim is not a symlink; if it's a regular directory the help is loaded as expected.

  • If you remove vim-bbye from the recreation init.vim, the help loads. However, this prevents vim -o working correctly with multiple files; only one window is opened.

@andrewferrier
Copy link
Author

Let me know if there's anything else I can do to help debug...

andrewferrier pushed a commit to andrewferrier/vim-symlink that referenced this issue Apr 24, 2020
@andrewferrier
Copy link
Author

If you're interested, I've created a workaround for this issue in my fork here: andrewferrier@0c037b5. It's probably not a proper fix, but it works for me for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant