458e3f10b723e5f4ebe64ab1e19064e4122fc95e
[stack/conf/vim.git] / addons / TagHighlight / autoload / TagHighlight / Version.vim
1 " Tag Highlighter:
2 "   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
3 " Copyright: Copyright (C) 2009-2011 A. S. Budden
4 "            Permission is hereby granted to use and distribute this code,
5 "            with or without modifications, provided that this copyright
6 "            notice is copied with it. Like anything else that's free,
7 "            the TagHighlight plugin is provided *as is* and comes with no
8 "            warranty of any kind, either expressed or implied. By using
9 "            this plugin, you agree that in no event will the copyright
10 "            holder be liable for any damages resulting from the use
11 "            of this software.
12
13 " ---------------------------------------------------------------------
14 try
15         if &cp || v:version < 700 || (exists('g:loaded_TagHLVersion') && (g:plugin_development_mode != 1))
16                 throw "Already loaded"
17         endif
18 catch
19         finish
20 endtry
21 let g:loaded_TagHLVersion = 1
22
23 function! TagHighlight#Version#LoadVersionInfo()
24         if has_key(g:TagHighlightPrivate, 'PluginVersion')
25                 return
26         endif
27
28         let g:TagHighlightPrivate['PluginVersion'] = {}
29         
30         let last_release_info = TagHighlight#LoadDataFile#LoadDataFile('release.txt')
31         let g:TagHighlightPrivate['PluginVersion']['LastRelease'] = last_release_info['release']
32
33         try
34                 let release_version_info = TagHighlight#LoadDataFile#LoadDataFile('version_info.txt')
35                 let g:TagHighlightPrivate['PluginVersion']['VersionInfo'] = release_version_info
36         catch /^Vim\%((\a\+)\)\=:E484/
37                 " Not a release version
38                 let g:TagHighlightPrivate['PluginVersion']['VersionInfo'] =
39                                         \ {
40                                         \    'release_clean': 'N/A',
41                                         \    'release_date': 'N/A',
42                                         \    'release_revid': 'N/A'
43                                         \ }
44         endtry
45 endfunction