changeset 69:6900302dae0b

Merge pull request #28 from GitHub.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 16 Jul 2015 21:40:52 -0700
parents 3ae6964078ab (current diff) ca61487b3215 (diff)
children 661a97eaf608
files autoload/gutentags.vim autoload/gutentags/ctags.vim doc/gutentags.txt
diffstat 3 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags.vim	Wed Jul 15 23:15:39 2015 -0700
+++ b/autoload/gutentags.vim	Thu Jul 16 21:40:52 2015 -0700
@@ -182,6 +182,17 @@
     endif
 endfunction
 
+" Get final ctags executable depending whether a filetype one is defined
+function! gutentags#get_ctags_executable() 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}
+  else
+    return g:gutentags_ctags_executable
+  endif
+endfunction
+
 " Get the suffix for how to execute an external command.
 function! gutentags#get_execute_cmd_suffix() abort
     if has('win32')
--- a/autoload/gutentags/ctags.vim	Wed Jul 15 23:15:39 2015 -0700
+++ b/autoload/gutentags/ctags.vim	Thu Jul 16 21:40:52 2015 -0700
@@ -45,7 +45,7 @@
     try
         " Build the command line.
         let l:cmd = gutentags#get_execute_cmd() . s:runner_exe
-        let l:cmd .= ' -e "' . g:gutentags_ctags_executable . '"'
+        let l:cmd .= ' -e "' . gutentags#get_ctags_executable() . '"'
         let l:cmd .= ' -t "' . a:tags_file . '"'
         let l:cmd .= ' -p "' . a:proj_dir . '"'
         if a:write_mode == 0 && filereadable(a:tags_file)
--- a/doc/gutentags.txt	Wed Jul 15 23:15:39 2015 -0700
+++ b/doc/gutentags.txt	Thu Jul 16 21:40:52 2015 -0700
@@ -223,6 +223,15 @@
                         Specifies the ctags executable to launch.
                         Defaults to `ctags`.
 
+                                     *gutentags_ctags_executable_{filetype}*
+g:gutentags_ctags_executable_{filetype}
+                        Specifies the ctags executable to launch for
+                        {filetype} files. It has precedence over
+                        g:gutentags_ctags_executable.
+                        Example: >
+                         let g:gutentags_ctags_executable_ruby = 'ripper-tags'
+<
+
                                                 *gutentags_tagfile*
 g:gutentags_tagfile
                         Specifies the name of the tag file to create. This