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

Error detected while processing E121: Undefined variable: s:cpo_save #619

Closed
kabirz opened this issue Nov 2, 2020 · 4 comments · Fixed by #621
Closed

Error detected while processing E121: Undefined variable: s:cpo_save #619

kabirz opened this issue Nov 2, 2020 · 4 comments · Fixed by #621

Comments

@kabirz
Copy link

kabirz commented Nov 2, 2020

Does this bug happen when you install plugin without vim-polyglot?

Describe the bug:
latest update cause neovim startup error everytime on ubuntu 20.04
···
Error detected while processing /home/zhp/.cache/dein/.cache/init.vim/.dein/ftdetect/ftdetect.vim:
line 3606:
E121: Undefined variable: s:cpo_save
E15: Invalid expression: s:cpo_save
line 3607:
E108: No such variable: "s:cpo_save"
Press ENTER or type command to continue
···
To Reproduce:

@cookie-s
Copy link
Contributor

cookie-s commented Nov 2, 2020

I'm seeing the same error.
I could make steps to reproduce: https://gist.github.com/cookie-s/bfcee76f24e36cd49a66b0ec55f26569

In this environment, the bundled file /root/.cache/dein/.cache/init.vim/.dein/ftdetect/ftdetect.vim is like

"""
""" vim-go https://github.com/fatih/vim-go/blob/master/ftdetect/gofiletype.vim
"""

let s:cpo_save = &cpo
set cpo&vim

let &cpo = s:cpo_save
unlet s:cpo_save

"""
""" vim-polyglot https://github.com/sheerun/vim-polyglot/blob/master/ftdetect/polyglot.vim
"""

if exists("did_load_polyglot")
  finish
endif

let did_load_polyglot = 1

let s:cpo_save = &cpo
set cpo&vim

augroup filetypedetect
  runtime! filetype.vim
  runtime! ftdetect/*.vim
augroup END

let &cpo = s:cpo_save
unlet s:cpo_save

So I think the error flow is

  1. vim-go let s:cpo_save = &cpo
  2. vim-go unlet s:cpo_save
  3. In vim-polyglot, exists("did_load_polyglot") is not 1.
  4. vim-polyglot let did_load_polyglot = 1
  5. vim-polyglot let s:cpo_save = &cpo " vim-polyglot
  6. vim-polyglot runtime! ftdetect/*.vim recursively loads self.
    1. vim-go let s:cpo_save = &cpo
    2. vim-go unlet s:cpo_save
    3. In vim-polyglot, exists("did_load_polyglot") is 1.
    4. vim-polyglot finish
  7. vim-polyglot let &cpo = s:cpo_save No such value!

@sheerun
Copy link
Owner

sheerun commented Nov 2, 2020

I guess renaming this variable will help?

@DanielPower
Copy link

I'm still experiencing the issue on the latest release.
Screen Shot 2020-11-02 at 2 39 21 PM

@DanielPower
Copy link

This seems to have been resolved for me in #623

sheerun added a commit that referenced this issue Nov 3, 2020
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

Successfully merging a pull request may close this issue.

4 participants