Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made vam#DisplayAddonInfo always show homepage generated from url

Added support for repository.homepage key

--HG--
branch : better-addon-info
  • Loading branch information...
commit 08526ce5151485129b1e6d890cc04b12e07c4517 1 parent c437ae9
Nikolai Aleksandrovich Pavlov ZyX-I authored
Showing with 12 additions and 2 deletions.
  1. +5 −2 autoload/vam.vim
  2. +7 −0 doc/vim-addon-manager.txt
7 autoload/vam.vim
View
@@ -279,14 +279,17 @@ fun! vam#DisplayAddonInfo(name)
call vam#Log('Plugin: '.name.((has_key(repository, 'version'))?(' version '.repository.version):('')), 'None')
if has_key(repository, 'vim_script_nr')
call vam#Log('Script number: '.repository.vim_script_nr, 'None')
- call vam#Log('Home page: http://www.vim.org/scripts/script.php?script_id='.repository.vim_script_nr, 'None')
+ call vam#Log('Vim.org page: http://www.vim.org/scripts/script.php?script_id='.repository.vim_script_nr, 'None')
+ endif
+ if has_key(repository, 'homepage')
+ call vam#Log('Home page: '.repository.homepage)
elseif repository.url =~? '^\w\+://github\.com/'
call vam#Log('Home page: https://github.com/'.substitute(repository.url, '^\V\w\+://github.com/\v([^/]+\/[^/]{-}%(\.git)?)%(\/|$)@=.*', '\1', ''), 'None')
elseif repository.url =~? '^\w\+://bitbucket\.org/'
call vam#Log('Home page: https://bitbucket.org/'.substitute(repository.url, '^\V\w\+://bitbucket.org/\v([^/]+\/[^/]+).*', '\1', ''), 'None')
endif
call vam#Log('Source URL: '.repository.url.' (type '.get(repository, 'type', 'archive').')', 'None')
- for key in filter(keys(repository), 'v:val!~#''\vurl|vim_script_nr|version|type''')
+ for key in filter(keys(repository), 'v:val!~#''\vurl|vim_script_nr|version|type|homepage''')
call vam#Log(key.': '.string(repository[key]), 'None')
endfor
endfun
7 doc/vim-addon-manager.txt
View
@@ -746,6 +746,13 @@ repository *addon-info-repository*
addon-info
Contains addon information in case plugin does not supply its
own addon-info file.
+ vim_script_nr
+ Contains www.vim.org script ID.
+ homepage
+ Contains home page URL. Though it is possible to use it, VAM
+ currently is also able to use repository.url to determine
+ plugin home page (github and bitbucket sources only). May be
+ the only source of home page URL in the future.
*addon-info-hooks*
post-install-hook *addon-info-post-install-hook*
Please sign in to comment.
Something went wrong with that request. Please try again.