changeset 216:425157bdd024

Merge pull request 172 from Github.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 12 Jun 2018 21:54:06 -0700
parents 179683b0f54c (diff) 8e6156c4dff1 (current diff)
children d7fdcb1c6a65
files
diffstat 5 files changed, 34 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/README.md	Sat Apr 21 01:38:39 2018 +0900
+++ b/README.md	Tue Jun 12 21:54:06 2018 -0700
@@ -70,6 +70,12 @@
 I don't want to have to think about it, and probably neither do you.
 
 
+# Related Projects
+
+* [gutentags_plus](https://github.com/skywind3000/gutentags_plus): handles
+  switching between `cscope` databases automatically before performing a search
+  query.
+
 [Pathogen]: https://github.com/tpope/vim-pathogen
 [ctrlp]: https://github.com/kien/ctrlp.vim
 
--- a/autoload/gutentags.vim	Sat Apr 21 01:38:39 2018 +0900
+++ b/autoload/gutentags.vim	Tue Jun 12 21:54:06 2018 -0700
@@ -549,7 +549,7 @@
 endfunction
 
 function! gutentags#default_io_cb(chan, msg) abort
-	call gutentags#trace(a:msg)
+   call gutentags#trace(string(a:msg))
 endfunction
 
 if has('nvim')
@@ -563,18 +563,19 @@
     endfunction
 
     function! gutentags#build_default_job_options(module) abort
-        let l:job_opts = {
-                    \'on_exit': function(
-                    \    '<SID>nvim_job_exit_wrapper',
-                    \    ['gutentags#'.a:module.'#on_job_exit']),
-                    \'on_stdout': function(
-                    \    '<SID>nvim_job_out_wrapper',
-                    \    ['gutentags#default_io_cb']),
-                    \'on_stderr': function(
-                    \    '<SID>nvim_job_out_wrapper',
-                    \    ['gutentags#default_io_cb'])
-                    \}
-        return l:job_opts
+       " Neovim kills jobs on exit, which is what we want.
+       let l:job_opts = {
+                \'on_exit': function(
+                \    '<SID>nvim_job_exit_wrapper',
+                \    ['gutentags#'.a:module.'#on_job_exit']),
+                \'on_stdout': function(
+                \    '<SID>nvim_job_out_wrapper',
+                \    ['gutentags#default_io_cb']),
+                \'on_stderr': function(
+                \    '<SID>nvim_job_out_wrapper',
+                \    ['gutentags#default_io_cb'])
+                \}
+       return l:job_opts
     endfunction
 
     function! gutentags#start_job(cmd, opts) abort
@@ -584,10 +585,11 @@
     " Vim8 job API.
     function! gutentags#build_default_job_options(module) abort
         let l:job_opts = {
-                    \'exit_cb': 'gutentags#'.a:module.'#on_job_exit',
-                    \'out_cb': 'gutentags#default_io_cb',
-                    \'err_cb': 'gutentags#default_io_cb'
-                    \}
+                 \'exit_cb': 'gutentags#'.a:module.'#on_job_exit',
+                 \'out_cb': 'gutentags#default_io_cb',
+                 \'err_cb': 'gutentags#default_io_cb',
+                 \'stoponexit': 'term'
+                 \}
         return l:job_opts
     endfunction
 
--- a/doc/gutentags.txt	Sat Apr 21 01:38:39 2018 +0900
+++ b/doc/gutentags.txt	Tue Jun 12 21:54:06 2018 -0700
@@ -629,6 +629,11 @@
                         generated code database to Vim by running `:cs add`
                         (see |:cscope|).
                         Defaults to 1.
+
+People using `cscope` or `gtags_cscope` across multiple projects in the same
+Vim instance might be interested in the `gutentags_plus` plugin, which handles
+switching databases automatically before performing a query. 
+See https://github.com/skywind3000/gutentags_plus.
       
 =============================================================================
 5. Project Settings                             *gutentags-project-settings*
--- a/plat/unix/update_tags.sh	Sat Apr 21 01:38:39 2018 +0900
+++ b/plat/unix/update_tags.sh	Tue Jun 12 21:54:06 2018 -0700
@@ -117,6 +117,8 @@
             done > "${TAGS_FILE}.files"
         fi
         CTAGS_ARGS="${CTAGS_ARGS} -L ${TAGS_FILE}.files"
+        # Clear project root if we have a file list
+        PROJECT_ROOT=""
     fi
     echo "Running ctags on whole project"
     echo "$CTAGS_EXE -f \"$TAGS_FILE.temp\" $CTAGS_ARGS \"$PROJECT_ROOT\""
--- a/plat/win32/update_tags.cmd	Sat Apr 21 01:38:39 2018 +0900
+++ b/plat/win32/update_tags.cmd	Tue Jun 12 21:54:06 2018 -0700
@@ -106,7 +106,6 @@
     )
 )
 if ["%INDEX_WHOLE_PROJECT%"]==["1"] (
-    set CTAGS_ARGS=%CTAGS_ARGS% "%PROJECT_ROOT%"
     if not ["%FILE_LIST_CMD%"]==[""] (
         echo Running custom file lister >> %LOG_FILE%
         set use_raw_list=0
@@ -124,6 +123,8 @@
             for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo %PROJECT_ROOT%\%%F >> %TAGS_FILE%.files
         )
         set CTAGS_ARGS=%CTAGS_ARGS% -L %TAGS_FILE%.files
+    ) else (
+        set CTAGS_ARGS=%CTAGS_ARGS% "%PROJECT_ROOT%"
     )
 )