changeset 225:174cfa3cf21a

Merge pull request 207 from Github.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 11 Nov 2018 19:43:03 -0800
parents a746af898281 (diff) 6110cf824e50 (current diff)
children f2fd7d5835d9
files
diffstat 3 files changed, 85 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.github/ISSUE_TEMPLATE/bug_report.md	Sun Nov 11 19:43:03 2018 -0800
@@ -0,0 +1,27 @@
+---
+name: Bug report
+about: Something's wrong?
+
+---
+
+**Describe the bug**
+Describe what the bug is about, and what you expected. Don't forget to format things nicely with Markdown. If applicable, post screenshots.
+
+**Steps to reproduce**
+1. Do this '...'
+2. Do that '...'
+3. Etc.
+
+**Share your setup**
+- What OS and version of Vim are you using?
+- What version of `ctags`, `gtags`, or whatever do you have installed?
+- Are you using `g:gutentags_cache_dir`?
+
+**Post the logs**
+- Run `:let g:gutentags_trace = 1`.
+- Reproduce the bug.
+- Run `:messages` and show the messages that Gutentags posted.
+- Look for the `tags.log` file that Gutentags' script left behind, and post its contents.
+
+**Additional context**
+Add any other context about the problem here.
--- a/autoload/gutentags.vim	Wed Sep 19 18:52:19 2018 -0400
+++ b/autoload/gutentags.vim	Sun Nov 11 19:43:03 2018 -0800
@@ -31,10 +31,10 @@
 
 " Prints a message if debug tracing is enabled.
 function! gutentags#trace(message, ...)
-   if g:gutentags_trace || (a:0 && a:1)
-       let l:message = "gutentags: " . a:message
-       echom l:message
-   endif
+    if g:gutentags_trace || (a:0 && a:1)
+        let l:message = "gutentags: " . a:message
+        echom l:message
+    endif
 endfunction
 
 " Strips the ending slash in a path.
@@ -420,11 +420,24 @@
 
 " (Re)Generate the tags file for the current buffer's file.
 function! s:manual_update_tags(bang) abort
-    let l:bn = bufnr('%')
-    for module in g:gutentags_modules
-        call s:update_tags(l:bn, module, a:bang, 0)
-    endfor
-    silent doautocmd User GutentagsUpdating
+    let l:restore_prev_trace = 0
+    let l:prev_trace = g:gutentags_trace
+    if &verbose > 0
+        let g:gutentags_trace = 1
+        let l:restore_prev_trace = 1
+    endif
+
+    try
+        let l:bn = bufnr('%')
+        for module in g:gutentags_modules
+            call s:update_tags(l:bn, module, a:bang, 0)
+        endfor
+        silent doautocmd User GutentagsUpdating
+    finally
+        if l:restore_prev_trace
+            let g:gutentags_trace = l:prev_trace
+        endif
+    endtry
 endfunction
 
 " (Re)Generate the tags file for a buffer that just go saved.
@@ -549,7 +562,7 @@
 endfunction
 
 function! gutentags#default_io_cb(chan, msg) abort
-   call gutentags#trace(string(a:msg))
+    call gutentags#trace(string(a:msg))
 endfunction
 
 if has('nvim')
@@ -601,21 +614,21 @@
 " Returns which modules are currently generating something for the
 " current buffer.
 function! gutentags#inprogress()
-   " Does this buffer have gutentags enabled?
-   if !exists('b:gutentags_files')
-      return []
-   endif
+    " Does this buffer have gutentags enabled?
+    if !exists('b:gutentags_files')
+        return []
+    endif
 
-   " Find any module that has a job in progress for any of this buffer's
-   " tags files.
-   let l:modules_in_progress = []
-   for [module, tags_file] in items(b:gutentags_files)
-      let l:jobidx = gutentags#find_job_index_by_tags_file(module, tags_file)
-      if l:jobidx >= 0
-         call add(l:modules_in_progress, module)
-      endif
-   endfor
-   return l:modules_in_progress
+    " Find any module that has a job in progress for any of this buffer's
+    " tags files.
+    let l:modules_in_progress = []
+    for [module, tags_file] in items(b:gutentags_files)
+        let l:jobidx = gutentags#find_job_index_by_tags_file(module, tags_file)
+        if l:jobidx >= 0
+            call add(l:modules_in_progress, module)
+        endif
+    endfor
+    return l:modules_in_progress
 endfunction
 
 " }}}
--- a/doc/gutentags.txt	Wed Sep 19 18:52:19 2018 -0400
+++ b/doc/gutentags.txt	Sun Nov 11 19:43:03 2018 -0800
@@ -160,6 +160,9 @@
                         that they can start working again when you re-enable
                         Gutentags.
 
+                        {only available when
+                        |gutentags_define_advanced_commands| is set}
+
                                                 *GutentagsToggleTrace*
 :GutentagsToggleTrace
                         If you want to keep an eye on what Gutentags is doing,
@@ -172,6 +175,9 @@
                         Gutentags redirect the output of the tag generation
                         script to a `.log` file in the project root.
 
+                        {only available when
+                        |gutentags_define_advanced_commands| is set}
+
 
 Gutentags also has some user auto-commands (see |User| and |:doautocmd|):
 
@@ -266,7 +272,21 @@
                         re-enable Gutentags, you won't have some buffers
                         mysteriously working while others (those open last)
                         don't.
-                        Defaults to 1.
+                        Defaults to `1`.
+
+                                                *gutentags_trace*
+g:gutentags_trace
+                        When true, Gutentags will spit out debugging
+                        information as Vim messages (which you can later read
+                        with |:messages|). It also runs its background scripts
+                        with extra parameters to log activity to a `tags.log`
+                        file that you can also inspect for more information.
+
+                        Note: you can run `:verbose GutentagsUpdate` to
+                        temporarily set |g:gutentags_trace| to `1` for that
+                        update only.
+
+                        Defaults to `0`.
 
                                                 *gutentags_dont_load*
 g:gutentags_dont_load