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

Undefined variable: s:triggers #132

Closed
mhinz opened this issue Dec 4, 2014 · 3 comments
Closed

Undefined variable: s:triggers #132

mhinz opened this issue Dec 4, 2014 · 3 comments
Labels

Comments

@mhinz
Copy link
Contributor

mhinz commented Dec 4, 2014

Hi!

I'm not even sure if this is an issue, since I see no way around it. I upgraded plug, which pulled in 044c3a6.

Immediately after that I did :PlugUpdate. The old plug#begin() was already finished (hence there's no s:triggers yet). This leads to:

Error detected while processing function <SNR>2_update..<SNR>2_update_impl..<SNR>2_update_finish..<SNR>2_finish.. plug#end:
line   22:
E121: Undefined variable: s:triggers

This means that s:update() already called the new definitions that rely on s:triggers, although I expected Vim to be using the old definitions, since the autoload file was already loaded.

This is my guess at least, since I don't see any other way of s:triggers not being defined otherwise.

If my guess is right, it's something that is documented wrongly (well, or a bug). I had no time to dive into the Vim sources yet.

Since it's more of a question than an issue, I'll close this one right away but hope for an answer anyway. :)

EDIT:

Nevermind. I followed all the functions of s:upgrade(), but totally overlooked the fact that :PlugUpgrade itself is sourcing the new file afterwards. So I understand what happens at least.

I guess one could argue, if resourcing is really needed after upgrades, since it can lead to such errors.

@junegunn
Copy link
Owner

junegunn commented Dec 5, 2014

Geez, looks like every time I introduce a new s: variable, I break clean upgrade. I should've added the default definition of it to the beginning of the plug.vim, even though it doesn't guarantee that the new code will work correctly, but unfortunately I forgot to do so. 2ee153d

Ideally, the purpose of PlugUpgrade is to upgrade vim-plug without requiring a restart of Vim, but in reality it may not work as expected especially when new s: variables are introduced :(

EDIT: removed irrelevant details

@junegunn junegunn added the bug label Dec 5, 2014
@mhinz
Copy link
Contributor Author

mhinz commented Dec 5, 2014

Yup, I think this solution is good enough, if you never forget to add new stuff in the right places. :-)

Thanks!

@junegunn
Copy link
Owner

junegunn commented Dec 5, 2014

if you never forget to add new stuff in the right places

😲

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

No branches or pull requests

2 participants