1
1
" Vim script
2
2
" Author: Peter Odding <peter@peterodding.com>
3
- " Last Change: June 14 , 2011
3
+ " Last Change: June 18 , 2011
4
4
" URL: http://peterodding.com/code/vim/easytags/
5
5
6
- let s: script = ' easytags.vim'
7
-
8
6
" Public interface through (automatic) commands. {{{1
9
7
10
8
function ! xolox#easytags#register (global ) " {{{2
@@ -59,7 +57,7 @@ function! xolox#easytags#autoload() " {{{2
59
57
let b: easytags_last_highlighted = localtime ()
60
58
endif
61
59
catch
62
- call xolox#misc#msg#warn (" %s: %s (at %s)" , s: script , v: exception , v: throwpoint )
60
+ call xolox#misc#msg#warn (" easytags.vim %s: %s (at %s)" , g: easytags_version , v: exception , v: throwpoint )
63
61
endtry
64
62
endfunction
65
63
@@ -76,14 +74,14 @@ function! xolox#easytags#update(silent, filter_tags, filenames) " {{{2
76
74
if ! firstrun
77
75
let num_filtered = s: filter_merge_tags (a: filter_tags , tagsfile, output)
78
76
if cfile != ' '
79
- let msg = " %s: Updated tags for %s in %s."
80
- call xolox#misc#timer#stop (msg, s: script , expand (' %:p:~' ), starttime)
77
+ let msg = " easytags.vim %s: Updated tags for %s in %s."
78
+ call xolox#misc#timer#stop (msg, g: easytags_version , expand (' %:p:~' ), starttime)
81
79
elseif ! empty (a: filenames )
82
- let msg = " %s: Updated tags in %s."
83
- call xolox#misc#timer#stop (msg, s: script , starttime)
80
+ let msg = " easytags.vim %s: Updated tags in %s."
81
+ call xolox#misc#timer#stop (msg, g: easytags_version , starttime)
84
82
else
85
- let msg = " %s: Filtered %i invalid tags in %s."
86
- call xolox#misc#timer#stop (msg, s: script , num_filtered, starttime)
83
+ let msg = " easytags.vim %s: Filtered %i invalid tags in %s."
84
+ call xolox#misc#timer#stop (msg, g: easytags_version , num_filtered, starttime)
87
85
endif
88
86
endif
89
87
" When :UpdateTags was executed manually we'll refresh the dynamic
@@ -93,7 +91,7 @@ function! xolox#easytags#update(silent, filter_tags, filenames) " {{{2
93
91
endif
94
92
return 1
95
93
catch
96
- call xolox#misc#msg#warn (" %s: %s (at %s)" , s: script , v: exception , v: throwpoint )
94
+ call xolox#misc#msg#warn (" easytags.vim %s: %s (at %s)" , g: easytags_version , v: exception , v: throwpoint )
97
95
endtry
98
96
endfunction
99
97
@@ -169,7 +167,7 @@ endfunction
169
167
function ! s: run_ctags (starttime, cfile , tagsfile, firstrun, cmdline) " {{{3
170
168
let lines = []
171
169
if a: cmdline != ' '
172
- call xolox#misc#msg#debug (" %s: Executing %s" , s: script , a: cmdline )
170
+ call xolox#misc#msg#debug (" easytags.vim %s: Executing %s. " , g: easytags_version , a: cmdline )
173
171
try
174
172
let lines = xolox#shell#execute (a: cmdline , 1 )
175
173
catch /^Vim\%((\a\+)\)\=:E117/
@@ -183,9 +181,9 @@ function! s:run_ctags(starttime, cfile, tagsfile, firstrun, cmdline) " {{{3
183
181
endtry
184
182
if a: firstrun
185
183
if a: cfile != ' '
186
- call xolox#misc#timer#stop (" %s: Created tags for %s in %s." , s: script , expand (' %:p:~' ), a: starttime )
184
+ call xolox#misc#timer#stop (" easytags.vim %s: Created tags for %s in %s." , g: easytags_version , expand (' %:p:~' ), a: starttime )
187
185
else
188
- call xolox#misc#timer#stop (" %s: Created tags in %s." , s: script , a: starttime )
186
+ call xolox#misc#timer#stop (" easytags.vim %s: Created tags in %s." , g: easytags_version , a: starttime )
189
187
endif
190
188
endif
191
189
endif
@@ -280,8 +278,8 @@ function! xolox#easytags#highlight() " {{{2
280
278
try
281
279
execute command
282
280
catch /^Vim\%((\a\+)\)\=:E339/
283
- let msg = " easytags.vim: Failed to highlight %i %s tags because pattern is too big! (%i KB)"
284
- call xolox#misc#msg#warn (printf ( msg, len (matches), tagkind.hlgroup, len (pattern) / 1024 ) )
281
+ let msg = " easytags.vim %s : Failed to highlight %i %s tags because pattern is too big! (%i KB)"
282
+ call xolox#misc#msg#warn (msg, g: easytags_version , len (matches), tagkind.hlgroup, len (pattern) / 1024 )
285
283
endtry
286
284
endif
287
285
endif
@@ -291,12 +289,12 @@ function! xolox#easytags#highlight() " {{{2
291
289
if bufname == ' '
292
290
let bufname = ' unnamed buffer #' . bufnr (' %' )
293
291
endif
294
- let msg = " %s: Highlighted tags in %s in %s%s."
295
- call xolox#misc#timer#stop (msg, s: script , bufname , starttime, used_python ? " (using Python)" : " " )
292
+ let msg = " easytags.vim %s: Highlighted tags in %s in %s%s."
293
+ call xolox#misc#timer#stop (msg, g: easytags_version , bufname , starttime, used_python ? " (using Python)" : " " )
296
294
return 1
297
295
endif
298
296
catch
299
- call xolox#misc#msg#warn (" %s: %s (at %s)" , s: script , v: exception , v: throwpoint )
297
+ call xolox#misc#msg#warn (" easytags.vim %s: %s (at %s)" , g: easytags_version , v: exception , v: throwpoint )
300
298
endtry
301
299
endfunction
302
300
@@ -312,8 +310,8 @@ function! xolox#easytags#by_filetype(undo) " {{{2
312
310
let [headers, entries] = xolox#easytags#read_tagsfile (global_tagsfile)
313
311
call s: save_by_filetype (headers, entries)
314
312
call rename (global_tagsfile, disabled_tagsfile)
315
- let msg = " 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."
316
- call xolox#misc#msg#info (msg, g: easytags_file , g: easytags_by_filetype , disabled_tagsfile)
313
+ 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."
314
+ call xolox#misc#msg#info (msg, g: easytags_version , g: easytags_file , g: easytags_by_filetype , disabled_tagsfile)
317
315
else
318
316
let headers = []
319
317
let all_entries = []
@@ -322,10 +320,10 @@ function! xolox#easytags#by_filetype(undo) " {{{2
322
320
call extend (all_entries, entries)
323
321
endfor
324
322
call xolox#easytags#write_tagsfile (global_tagsfile, headers, all_entries)
325
- call xolox#misc#msg#info (" Finished copying tags from %s to %s!" , g: easytags_by_filetype , g: easytags_file )
323
+ 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 )
326
324
endif
327
325
catch
328
- call xolox#misc#msg#warn (" %s: %s (at %s)" , s: script , v: exception , v: throwpoint )
326
+ call xolox#misc#msg#warn (" easytags.vim %s: %s (at %s)" , g: easytags_version , v: exception , v: throwpoint )
329
327
endtry
330
328
endfunction
331
329
@@ -369,8 +367,8 @@ function! xolox#easytags#supported_filetypes() " {{{2
369
367
endif
370
368
endtry
371
369
let s: supported_filetypes = map (copy (listing), ' s:check_filetype(listing, v:val)' )
372
- let msg = " %s: Retrieved %i supported languages in %s."
373
- call xolox#misc#timer#stop (msg, s: script , len (s: supported_filetypes ), starttime)
370
+ let msg = " easytags.vim %s: Retrieved %i supported languages in %s."
371
+ call xolox#misc#timer#stop (msg, g: easytags_version , len (s: supported_filetypes ), starttime)
374
372
endif
375
373
return s: supported_filetypes
376
374
endfunction
@@ -473,7 +471,7 @@ function! s:cache_tagged_files() " {{{3
473
471
call s: cache_tagged_files_in (fname, ftime, entries)
474
472
endif
475
473
endfor
476
- call xolox#misc#timer#stop (" %s: Initialized cache of tagged files in %s" , s: script , starttime)
474
+ call xolox#misc#timer#stop (" easytags.vim %s: Initialized cache of tagged files in %s. " , g: easytags_version , starttime)
477
475
endif
478
476
endfunction
479
477
0 commit comments