diff autoload/gutentags/ctags.vim @ 185:685b81826b68

Only check for the ctags executable once.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 30 May 2017 12:16:20 -0700
parents 3cd4597fb86b
children 5fb056a9eefb
line wrap: on
line diff
--- a/autoload/gutentags/ctags.vim	Sat Apr 22 10:32:30 2017 -0700
+++ b/autoload/gutentags/ctags.vim	Tue May 30 12:16:20 2017 -0700
@@ -35,6 +35,7 @@
 
 " Gutentags Module Interface {{{
 
+let s:did_check_exe = 0
 let s:runner_exe = gutentags#get_plat_file('update_tags')
 let s:unix_redir = (&shellredir =~# '%s') ? &shellredir : &shellredir . ' %s'
 
@@ -54,11 +55,14 @@
     endif
 
     " Check if the ctags executable exists.
-    if g:gutentags_enabled && executable(expand(g:gutentags_ctags_executable, 1)) == 0
-        let g:gutentags_enabled = 0
-        echoerr "Executable '".g:gutentags_ctags_executable."' can't be found. "
-                    \."Gutentags will be disabled. You can re-enable it by "
-                    \."setting g:gutentags_enabled back to 1."
+    if s:did_check_exe == 0
+        if g:gutentags_enabled && executable(expand(g:gutentags_ctags_executable, 1)) == 0
+            let g:gutentags_enabled = 0
+            echoerr "Executable '".g:gutentags_ctags_executable."' can't be found. "
+                        \."Gutentags will be disabled. You can re-enable it by "
+                        \."setting g:gutentags_enabled back to 1."
+        endif
+        let s:did_check_exe = 1
     endif
 endfunction