Skip to content
This repository
Browse code

Remove useless "easytags_register_late" option

Because s:RegisterTagsFile() is (supposed to be) idempotent we can just
call it twice instead of relying on users to properly configure the
plug-in. See the discussion on the previous commit* for more information.

* http://github.com/xolox/vim-easytags/commit/3466f61
  • Loading branch information...
commit c1635d69d44980cfd5b8d6f770deeb02780279b9 1 parent 3466f61
Peter Odding authored April 12, 2011

Showing 1 changed file with 10 additions and 19 deletions. Show diff stats Hide diff stats

  1. 29  plugin/easytags.vim
29  plugin/easytags.vim
... ...
@@ -1,10 +1,10 @@
1 1
 " Vim plug-in
2 2
 " Author: Peter Odding <peter@peterodding.com>
3  
-" Last Change: April 11, 2011
  3
+" Last Change: April 12, 2011
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.3
  7
+" Version: 2.2.4
8 8
 
9 9
 " Support for automatic update using the GLVS plug-in.
10 10
 " GetLatestVimScripts: 3114 1 :AutoInstall: easytags.zip
@@ -50,10 +50,6 @@ if !exists('g:easytags_include_members')
50 50
   let g:easytags_include_members = 0
51 51
 endif
52 52
 
53  
-if !exists('g:easytags_register_late')
54  
-  let g:easytags_register_late = 0
55  
-endif
56  
-
57 53
 function! s:InitEasyTags(version)
58 54
   " Check that the location of Exuberant Ctags has been configured or that the
59 55
   " correct version of the program exists in one of its default locations.
@@ -156,13 +152,10 @@ function! s:RegisterTagsFile()
156 152
   endif
157 153
 endfunction
158 154
 
159  
-" By default this plug-in initializes the &tags option as soon as possible so
160  
-" that the global tags file is available when using "vim -t some_tag". If you
161  
-" don't use "vim -t" and want to defer registering the global tags file until
162  
-" the interface has been initialized you can set g:easytags_register_late=1.
163  
-if !g:easytags_register_late
164  
-  call s:RegisterTagsFile()
165  
-endif
  155
+" The plug-in initializes the &tags option as soon as possible so that the
  156
+" global tags file is available when using "vim -t some_tag". If &tags is
  157
+" reset, we'll try again on the "VimEnter" automatic command event (below).
  158
+call s:RegisterTagsFile()
166 159
 
167 160
 " The :UpdateTags and :HighlightTags commands. {{{1
168 161
 
@@ -173,12 +166,10 @@ command! -bar HighlightTags call xolox#easytags#highlight()
173 166
 
174 167
 augroup PluginEasyTags
175 168
   autocmd!
176  
-  if g:easytags_register_late
177  
-    " This is the alternative way of registering the global tags file using
178  
-    " the automatic command event "VimEnter". Apparently this makes the
179  
-    " easytags plug-in behave better when used together with tplugin?
180  
-    autocmd VimEnter * call s:RegisterTagsFile()
181  
-  endif
  169
+  " This is the alternative way of registering the global tags file using
  170
+  " the automatic command event "VimEnter". Apparently this makes the
  171
+  " plug-in behave better when used together with tplugin?
  172
+  autocmd VimEnter * call s:RegisterTagsFile()
182 173
   if g:easytags_always_enabled
183 174
     " TODO Also on FocusGained because tags files might be updated externally?
184 175
     autocmd BufReadPost,BufWritePost * call xolox#easytags#autoload()

0 notes on commit c1635d6

Please sign in to comment.
Something went wrong with that request. Please try again.