diff autoload/gutentags/ctags.vim @ 89:8bf96f9f649c

Add support for project types.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 01 Dec 2015 22:04:45 -0800
parents 7872cc9bbc2d
children edd488d8d37e
line wrap: on
line diff
--- a/autoload/gutentags/ctags.vim	Tue Nov 24 21:47:26 2015 -0800
+++ b/autoload/gutentags/ctags.vim	Tue Dec 01 22:04:45 2015 -0800
@@ -61,7 +61,7 @@
     try
         " Build the command line.
         let l:cmd = gutentags#get_execute_cmd() . s:runner_exe
-        let l:cmd .= ' -e "' . s:get_ctags_executable() . '"'
+        let l:cmd .= ' -e "' . s:get_ctags_executable(a:proj_dir) . '"'
         let l:cmd .= ' -t "' . a:tags_file . '"'
         let l:cmd .= ' -p "' . a:proj_dir . '"'
         if a:write_mode == 0 && l:tags_file_exists
@@ -128,11 +128,13 @@
 " Utilities {{{
 
 " Get final ctags executable depending whether a filetype one is defined
-function! s:get_ctags_executable() abort
+function! s:get_ctags_executable(proj_dir) abort
     "Only consider the main filetype in cases like 'python.django'
     let l:ftype = get(split(&filetype, '\.'), 0, '')
-    if exists('g:gutentags_ctags_executable_{l:ftype}')
-        return g:gutentags_ctags_executable_{l:ftype}
+    let l:proj_info = gutentags#get_project_info(a:proj_dir)
+    let l:type = get(l:proj_info, 'type', l:ftype)
+    if exists('g:gutentags_ctags_executable_{l:type}')
+        return g:gutentags_ctags_executable_{l:type}
     else
         return g:gutentags_ctags_executable
     endif