Skip to content

Commit 4e1131e

Browse files
committed
Move version variable to autoload script
1 parent 46d87b3 commit 4e1131e

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

autoload/xolox/easytags.vim

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
" Vim script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: July 9, 2011
3+
" Last Change: August 27, 2011
44
" URL: http://peterodding.com/code/vim/easytags/
55

6+
let g:xolox#easytags#version = '2.4.12'
7+
68
" Public interface through (automatic) commands. {{{1
79

810
function! xolox#easytags#register(global) " {{{2
@@ -65,7 +67,7 @@ function! xolox#easytags#autoload() " {{{2
6567
endif
6668
endif
6769
catch
68-
call xolox#misc#msg#warn("easytags.vim %s: %s (at %s)", g:easytags_version, v:exception, v:throwpoint)
70+
call xolox#misc#msg#warn("easytags.vim %s: %s (at %s)", g:xolox#easytags#version, v:exception, v:throwpoint)
6971
endtry
7072
endfunction
7173

@@ -88,13 +90,13 @@ function! xolox#easytags#update(silent, filter_tags, filenames) " {{{2
8890
endif
8991
if cfile != ''
9092
let msg = "easytags.vim %s: Updated tags for %s in %s."
91-
call xolox#misc#timer#stop(msg, g:easytags_version, expand('%:p:~'), starttime)
93+
call xolox#misc#timer#stop(msg, g:xolox#easytags#version, expand('%:p:~'), starttime)
9294
elseif have_args
9395
let msg = "easytags.vim %s: Updated tags in %s."
94-
call xolox#misc#timer#stop(msg, g:easytags_version, starttime)
96+
call xolox#misc#timer#stop(msg, g:xolox#easytags#version, starttime)
9597
else
9698
let msg = "easytags.vim %s: Filtered %i invalid tags in %s."
97-
call xolox#misc#timer#stop(msg, g:easytags_version, num_filtered, starttime)
99+
call xolox#misc#timer#stop(msg, g:xolox#easytags#version, num_filtered, starttime)
98100
endif
99101
endif
100102
" When :UpdateTags was executed manually we'll refresh the dynamic
@@ -104,7 +106,7 @@ function! xolox#easytags#update(silent, filter_tags, filenames) " {{{2
104106
endif
105107
return 1
106108
catch
107-
call xolox#misc#msg#warn("easytags.vim %s: %s (at %s)", g:easytags_version, v:exception, v:throwpoint)
109+
call xolox#misc#msg#warn("easytags.vim %s: %s (at %s)", g:xolox#easytags#version, v:exception, v:throwpoint)
108110
endtry
109111
endfunction
110112

@@ -183,7 +185,7 @@ endfunction
183185
function! s:run_ctags(starttime, cfile, tagsfile, firstrun, cmdline) " {{{3
184186
let lines = []
185187
if a:cmdline != ''
186-
call xolox#misc#msg#debug("easytags.vim %s: Executing %s.", g:easytags_version, a:cmdline)
188+
call xolox#misc#msg#debug("easytags.vim %s: Executing %s.", g:xolox#easytags#version, a:cmdline)
187189
try
188190
let lines = xolox#shell#execute(a:cmdline, 1)
189191
catch /^Vim\%((\a\+)\)\=:E117/
@@ -197,9 +199,9 @@ function! s:run_ctags(starttime, cfile, tagsfile, firstrun, cmdline) " {{{3
197199
endtry
198200
if a:firstrun
199201
if a:cfile != ''
200-
call xolox#misc#timer#stop("easytags.vim %s: Created tags for %s in %s.", g:easytags_version, expand('%:p:~'), a:starttime)
202+
call xolox#misc#timer#stop("easytags.vim %s: Created tags for %s in %s.", g:xolox#easytags#version, expand('%:p:~'), a:starttime)
201203
else
202-
call xolox#misc#timer#stop("easytags.vim %s: Created tags in %s.", g:easytags_version, a:starttime)
204+
call xolox#misc#timer#stop("easytags.vim %s: Created tags in %s.", g:xolox#easytags#version, a:starttime)
203205
endif
204206
return []
205207
endif
@@ -298,7 +300,7 @@ function! xolox#easytags#highlight() " {{{2
298300
execute command
299301
catch /^Vim\%((\a\+)\)\=:E339/
300302
let msg = "easytags.vim %s: Failed to highlight %i %s tags because pattern is too big! (%i KB)"
301-
call xolox#misc#msg#warn(msg, g:easytags_version, len(matches), tagkind.hlgroup, len(pattern) / 1024)
303+
call xolox#misc#msg#warn(msg, g:xolox#easytags#version, len(matches), tagkind.hlgroup, len(pattern) / 1024)
302304
endtry
303305
endif
304306
endif
@@ -309,11 +311,11 @@ function! xolox#easytags#highlight() " {{{2
309311
let bufname = 'unnamed buffer #' . bufnr('%')
310312
endif
311313
let msg = "easytags.vim %s: Highlighted tags in %s in %s%s."
312-
call xolox#misc#timer#stop(msg, g:easytags_version, bufname, starttime, used_python ? " (using Python)" : "")
314+
call xolox#misc#timer#stop(msg, g:xolox#easytags#version, bufname, starttime, used_python ? " (using Python)" : "")
313315
return 1
314316
endif
315317
catch
316-
call xolox#misc#msg#warn("easytags.vim %s: %s (at %s)", g:easytags_version, v:exception, v:throwpoint)
318+
call xolox#misc#msg#warn("easytags.vim %s: %s (at %s)", g:xolox#easytags#version, v:exception, v:throwpoint)
317319
endtry
318320
endfunction
319321

@@ -330,7 +332,7 @@ function! xolox#easytags#by_filetype(undo) " {{{2
330332
call s:save_by_filetype(0, headers, entries)
331333
call rename(global_tagsfile, disabled_tagsfile)
332334
let msg = "easytags.vim %s: Finished copying tags from %s to %s! Note that your old tags file has been renamed to %s instead of deleting it, should you want to restore it."
333-
call xolox#misc#msg#info(msg, g:easytags_version, g:easytags_file, g:easytags_by_filetype, disabled_tagsfile)
335+
call xolox#misc#msg#info(msg, g:xolox#easytags#version, g:easytags_file, g:easytags_by_filetype, disabled_tagsfile)
334336
else
335337
let headers = []
336338
let all_entries = []
@@ -339,10 +341,10 @@ function! xolox#easytags#by_filetype(undo) " {{{2
339341
call extend(all_entries, entries)
340342
endfor
341343
call xolox#easytags#write_tagsfile(global_tagsfile, headers, all_entries)
342-
call xolox#misc#msg#info("easytags.vim %s: Finished copying tags from %s to %s!", g:easytags_version, g:easytags_by_filetype, g:easytags_file)
344+
call xolox#misc#msg#info("easytags.vim %s: Finished copying tags from %s to %s!", g:xolox#easytags#version, g:easytags_by_filetype, g:easytags_file)
343345
endif
344346
catch
345-
call xolox#misc#msg#warn("easytags.vim %s: %s (at %s)", g:easytags_version, v:exception, v:throwpoint)
347+
call xolox#misc#msg#warn("easytags.vim %s: %s (at %s)", g:xolox#easytags#version, v:exception, v:throwpoint)
346348
endtry
347349
endfunction
348350

@@ -387,7 +389,7 @@ function! xolox#easytags#supported_filetypes() " {{{2
387389
endtry
388390
let s:supported_filetypes = map(copy(listing), 's:check_filetype(listing, v:val)')
389391
let msg = "easytags.vim %s: Retrieved %i supported languages in %s."
390-
call xolox#misc#timer#stop(msg, g:easytags_version, len(s:supported_filetypes), starttime)
392+
call xolox#misc#timer#stop(msg, g:xolox#easytags#version, len(s:supported_filetypes), starttime)
391393
endif
392394
return s:supported_filetypes
393395
endfunction
@@ -422,7 +424,7 @@ function! xolox#easytags#read_tagsfile(tagsfile) " {{{2
422424
endif
423425
endfor
424426
if num_invalid > 0
425-
call xolox#misc#msg#warn("easytags.vim %s: Ignored %i invalid line(s) in %s!", g:easytags_version, num_invalid, a:tagsfile)
427+
call xolox#misc#msg#warn("easytags.vim %s: Ignored %i invalid line(s) in %s!", g:xolox#easytags#version, num_invalid, a:tagsfile)
426428
endif
427429
return [headers, entries]
428430
endfunction
@@ -504,7 +506,7 @@ function! s:cache_tagged_files() " {{{3
504506
endif
505507
endif
506508
endfor
507-
call xolox#misc#timer#stop("easytags.vim %s: Initialized cache of tagged files in %s.", g:easytags_version, starttime)
509+
call xolox#misc#timer#stop("easytags.vim %s: Initialized cache of tagged files in %s.", g:xolox#easytags#version, starttime)
508510
endif
509511
endfunction
510512

plugin/easytags.vim

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Vim plug-in
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: July 9, 2011
3+
" Last Change: August 27, 2011
44
" URL: http://peterodding.com/code/vim/easytags/
55
" Requires: Exuberant Ctags (http://ctags.sf.net)
66

@@ -12,8 +12,6 @@ if &cp || exists('g:loaded_easytags')
1212
finish
1313
endif
1414

15-
let g:easytags_version = '2.4.11'
16-
1715
" Configuration defaults and initialization. {{{1
1816

1917
if !exists('g:easytags_file')
@@ -112,11 +110,11 @@ if !s:InitEasyTags(55)
112110
else
113111
let s:msg .= " Please download & install Exuberant Ctags from http://ctags.sf.net"
114112
endif
115-
echomsg printf(s:msg, g:easytags_version)
113+
echomsg printf(s:msg, g:xolox#easytags#version)
116114
else
117115
let s:msg = "easytags.vim %s: Plug-in not loaded because Exuberant Ctags 5.5"
118116
let s:msg .= " or newer is required while you have version %s installed!"
119-
echomsg printf(s:msg, g:easytags_version, g:easytags_ctags_version)
117+
echomsg printf(s:msg, g:xolox#easytags#version, g:easytags_ctags_version)
120118
endif
121119
unlet s:msg
122120
finish

0 commit comments

Comments
 (0)