|
4 | 4 | " URL: http://peterodding.com/code/vim/easytags/
|
5 | 5 | " Requires: Exuberant Ctags (http://ctags.sf.net)
|
6 | 6 | " License: MIT
|
7 |
| -" Version: 2.2.11 |
| 7 | +" Version: 2.2.12 |
8 | 8 |
|
9 | 9 | " Support for automatic update using the GLVS plug-in.
|
10 | 10 | " GetLatestVimScripts: 3114 1 :AutoInstall: easytags.zip
|
@@ -34,12 +34,14 @@ if !exists('g:easytags_resolve_links')
|
34 | 34 | let g:easytags_resolve_links = 0
|
35 | 35 | endif
|
36 | 36 |
|
37 |
| -if !exists('g:easytags_always_enabled') |
38 |
| - let g:easytags_always_enabled = 0 |
39 |
| -endif |
40 |
| - |
41 |
| -if !exists('g:easytags_on_cursorhold') |
42 |
| - let g:easytags_on_cursorhold = 1 |
| 37 | +if !exists('g:easytags_events') |
| 38 | + let g:easytags_events = [] |
| 39 | + if !exists('g:easytags_on_cursorhold') || g:easytags_on_cursorhold |
| 40 | + call extend(g:easytags_events, ['CursorHold', 'CursorHoldI']) |
| 41 | + endif |
| 42 | + if exists('g:easytags_always_enabled') && g:easytags_always_enabled |
| 43 | + call extend(g:easytags_events, ['BufReadPost', 'BufWritePost', 'FocusGained', 'ShellCmdPost', 'ShellFilterPost']) |
| 44 | + endif |
43 | 45 | endif
|
44 | 46 |
|
45 | 47 | if !exists('g:easytags_ignored_filetypes')
|
@@ -174,14 +176,13 @@ augroup PluginEasyTags
|
174 | 176 | " the automatic command event "VimEnter". Apparently this makes the
|
175 | 177 | " plug-in behave better when used together with tplugin?
|
176 | 178 | autocmd VimEnter * call s:RegisterTagsFile()
|
177 |
| - if g:easytags_always_enabled |
178 |
| - " TODO Also on FocusGained because tags files might be updated externally? |
179 |
| - autocmd BufReadPost,BufWritePost * call xolox#easytags#autoload() |
180 |
| - endif |
181 |
| - if g:easytags_on_cursorhold |
182 |
| - autocmd CursorHold,CursorHoldI * call xolox#easytags#autoload() |
183 |
| - autocmd BufReadPost * unlet! b:easytags_last_highlighted |
184 |
| - endif |
| 179 | + " Define the automatic commands to perform updating/highlighting. |
| 180 | + for s:eventname in g:easytags_events |
| 181 | + execute 'autocmd' s:eventname '* call xolox#easytags#autoload()' |
| 182 | + endfor |
| 183 | + " After reloading a buffer the dynamic syntax highlighting is lost. The |
| 184 | + " following code makes sure the highlighting is refreshed afterwards. |
| 185 | + autocmd BufReadPost * unlet! b:easytags_last_highlighted |
185 | 186 | augroup END
|
186 | 187 |
|
187 | 188 | " }}}1
|
|
0 commit comments