2 " Author: A. S. Budden <abudden _at_ gmail _dot_ com>
3 " Copyright: Copyright (C) 2009-2012 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
13 " ---------------------------------------------------------------------
15 if &cp || v:version < 700 || (exists('g:loaded_TagHLTagManager') && (g:plugin_development_mode != 1))
16 throw "Already loaded"
21 let g:loaded_TagHLTagManager = 1
23 function! TagHighlight#TagManager#InitialiseBufferTags()
24 if ! has_key(g:TagHighlightPrivate, 'OriginalTagsSetting')
25 let g:TagHighlightPrivate['OriginalTagsSetting'] = &g:tags
27 if ! exists('b:TagHighlightPrivate')
28 let b:TagHighlightPrivate = {}
30 if ! has_key(b:TagHighlightPrivate, 'OriginalTagsSetting')
31 let b:TagHighlightPrivate['OriginalTagsSetting'] = &tags
35 function! TagHighlight#TagManager#ConfigureTags()
36 if TagHighlight#Option#GetOption('DisableTagManager') == 1
39 let tagfilename = TagHighlight#Option#GetOption('TagFileName')
41 for library in b:TagHighlightLoadedLibraries
42 let types_folder = fnamemodify(library['Path'], ':h')
43 let tag_file_path = types_folder . '/' . tagfilename
44 if filereadable(tag_file_path)
45 let tagfiles += [tag_file_path]
49 let newtagsoption = b:TagHighlightPrivate['OriginalTagsSetting']
50 for tagfile in tagfiles
51 let newtagsoption .= ',' . escape(tagfile, ' ')
53 let &l:tags = newtagsoption