MarcWeber / vim-addon-manager

manage and install vim plugins (including their dependencies) in a sane way. If you have any trouble contact me. Usually I reply within 24 hours
Other
660 stars 59 forks source link

[patch] workaround for vim's function() bug with autoload #51

Closed jolan78 closed 12 years ago

jolan78 commented 13 years ago

to be honest I dont know exactly why but on a system with vim 7.0.305, function('vam_known_repositories#MergeSources') do not works. vim should scan the autoload directory , and I verified vim-addon-manager-known-repositories is in the runtimepath when function() is invoked but it doesn't works...

there is two options to bring backward compatibility : move MergeSources() out of autoload, or create a wrapper and keep vim-addon-manager-known-repositories.vim clean. I'm not sure this patch should be commited to the trunk, but it can be helpfull to people with an old vim.

diff --git a/plugin/vim-addon-manager-known-repositories.vim b/plugin/vim-addon-manager-known-repositories.vim index bdd91d6..936b894 100644 --- a/plugin/vim-addon-manager-known-repositories.vim +++ b/plugin/vim-addon-manager-known-repositories.vim @@ -4359,8 +4359,10 @@ let s:plugin_sources['localvimrc']['deprecated'] = "consider using vim-addon-loc let s:plugin_sources['localrc']['deprecated'] = "consider using vim-addon-local-vimrc cause it provides simple hash protection" "}}}

-call call(get(s:c,'MergeSources',function('vam_known_repositories#MergeSources')), +fun! s:CallMergeSource(plugin_sources, www_vim_org, scm_plugin_sources)

MarcWeber commented 13 years ago

I'll review this in a couple of days.

Eventually a simple runtimepath! call is enough to make it work.

I have to install older vim first.

MarcWeber commented 13 years ago

I've installed 7.0 today. I'm getting errors like:

E117: Unknown function: fnameescape E15: Invalid expression: 'source '.fnameescape(file)

Can you give me a reason why 7.0.x should be supported officially?

jolan78 commented 13 years ago

no reason to support it, but I use it on one of my servers, so I fixed it, and then posted it in case someone needs it.

MarcWeber commented 13 years ago

Excerpts from jolan78's message of Fri Sep 16 10:10:37 +0200 2011:

no reason to support it, but I use it on one of my servers, so I fixed it, and then posted it in case someone needs it.

So you're fine with me linking to your fix in the bugs section ?

I guess that's most simple for everyone. If you have stronger reasons ping back again.

jolan78 commented 13 years ago

of course you can.