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

Plugins with % in the name causes curl to fail to download them #111

Open pluong10 opened 11 years ago

pluong10 commented 11 years ago

The plugin Mark%2666, for example, VAM will modify the URL to ...Mark\%2666... As a result, CURL don't know how to download it, and so fails to install.

BTW, I'm using Windows.

MarcWeber commented 11 years ago

First % is only the storage location, not the download url.

If windows doesn't like % (because it has special meaning?) we have to fix the quoting. As a quick fix you can get all plugins by http://vam.mawercer.de/.

Something like this tells VAM to replace % by _:

fun MyPluginDirFromName(name)
  let dir = vam#DefaultPluginDirFromName
  return substitute(dir,'%','_', 'g')
endf
let g:vim_addon_manager['plugin_dir_by_name'] = 'MyPluginDirFromName'

If you want to help us find the correct way to quote '%' signs have a look at the function

 fun! vam#utils#Download(url, targetFile)

which is using RunInShell which calls ShellDSL

I may be able to provide a fix within 4 days or so if I can reproduce the issue.

marcusm commented 11 years ago

I had this issue today with javascript%2083 plugin. On windows of course. I retrieved the plugins from the http://vam.mawercer.de/ link, but I still get the error when starting vim. My temporary workaround was to copy the plugin files into the javascript/%2083 directory. A better fix would be nice. Is anyone working on one already?

MarcWeber commented 11 years ago

I've fixed it by adding the hack above to the downloader when choosing target Windows. Please note that there was a small bug. Of course the line should have been:

let dir = vam#DefaultPluginDirFromName(a:name)