Skip to content

Commit ee0966c

Browse files
committed
Never try to autoload plug-in for unsupported file types
1 parent 5207365 commit ee0966c

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

autoload/xolox/easytags.vim

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

66
" Public interface through (automatic) commands. {{{1
@@ -34,19 +34,23 @@ endfunction
3434

3535
function! xolox#easytags#autoload() " {{{2
3636
try
37-
" Update entries for current file in tags file?
38-
if xolox#misc#option#get('easytags_auto_update', 1)
39-
let pathname = s:resolve(expand('%:p'))
40-
if pathname != ''
41-
let tags_outdated = getftime(pathname) > getftime(xolox#easytags#get_tagsfile())
42-
if tags_outdated || !xolox#easytags#file_has_tags(pathname)
43-
call xolox#easytags#update(1, 0, [])
37+
let do_update = xolox#misc#option#get('easytags_auto_update', 1)
38+
let do_highlight = xolox#misc#option#get('easytags_auto_highlight', 1) && &eventignore !~? '\<syntax\>'
39+
" Don't execute this function for unsupported file types (doesn't load
40+
" the list of file types if updates and highlighting are both disabled).
41+
if (do_update || do_highlight) && index(xolox#easytags#supported_filetypes(), &ft) >= 0
42+
" Update entries for current file in tags file?
43+
if do_update
44+
let pathname = s:resolve(expand('%:p'))
45+
if pathname != ''
46+
let tags_outdated = getftime(pathname) > getftime(xolox#easytags#get_tagsfile())
47+
if tags_outdated || !xolox#easytags#file_has_tags(pathname)
48+
call xolox#easytags#update(1, 0, [])
49+
endif
4450
endif
4551
endif
46-
endif
47-
" Apply highlighting of tags to current buffer?
48-
if xolox#misc#option#get('easytags_auto_highlight', 1)
49-
if &eventignore !~? '\<syntax\>'
52+
" Apply highlighting of tags to current buffer?
53+
if do_highlight
5054
if !exists('b:easytags_last_highlighted')
5155
call xolox#easytags#highlight()
5256
else

plugin/easytags.vim

Lines changed: 2 additions & 2 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: June 27, 2011
3+
" Last Change: July 9, 2011
44
" URL: http://peterodding.com/code/vim/easytags/
55
" Requires: Exuberant Ctags (http://ctags.sf.net)
66

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

15-
let g:easytags_version = '2.4.9'
15+
let g:easytags_version = '2.4.10'
1616

1717
" Configuration defaults and initialization. {{{1
1818

0 commit comments

Comments
 (0)