changeset 243:050d0549ecf3

Add `g:gutentags_add_ctrlp_root_markers` option. This lets users prevent Gutentags from appending CtrlP root markers, if found.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 12 Mar 2019 21:43:50 -0700
parents 23ce1c1b359f
children d3f9a92399d1
files autoload/gutentags.vim doc/gutentags.txt plugin/gutentags.vim
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags.vim	Tue Mar 12 21:31:02 2019 -0700
+++ b/autoload/gutentags.vim	Tue Mar 12 21:43:50 2019 -0700
@@ -188,7 +188,7 @@
     let l:path = gutentags#stripslash(a:path)
     let l:previous_path = ""
     let l:markers = g:gutentags_project_root[:]
-    if exists('g:ctrlp_root_markers')
+    if g:gutentags_add_ctrlp_root_markers && exists('g:ctrlp_root_markers')
         for crm in g:ctrlp_root_markers
             if index(l:markers, crm) < 0
                 call add(l:markers, crm)
--- a/doc/gutentags.txt	Tue Mar 12 21:31:02 2019 -0700
+++ b/doc/gutentags.txt	Tue Mar 12 21:43:50 2019 -0700
@@ -343,6 +343,14 @@
                         The default markers are:
                         `['.git', '.hg', '.bzr', '_darcs', '_darcs', '_FOSSIL_', '.fslckout']`
 
+                                            *gutentags_add_ctrlp_root_markers*
+g:gutentags_add_ctrlp_root_markers
+                        If Gutentags finds `g:ctrlp_root_markers` (used by the
+                        CtrlP plugin), it will append those root markers to
+                        the existing ones (see |g:gutentags_project_root|).
+                        Set this to 0 to stop it from happening.
+                        Defaults to 1.
+
                                                 *gutentags_exclude_filetypes*
 g:gutentags_exclude_filetypes
                         A |List| of file types (see |'filetype'|) that Gutentags
--- a/plugin/gutentags.vim	Tue Mar 12 21:31:02 2019 -0700
+++ b/plugin/gutentags.vim	Tue Mar 12 21:43:50 2019 -0700
@@ -38,6 +38,7 @@
 let g:gutentags_init_user_func = get(g:, 'gutentags_init_user_func', 
             \get(g:, 'gutentags_enabled_user_func', ''))
 
+let g:gutentags_add_ctrlp_root_markers = get(g:, 'gutentags_add_ctrlp_root_markers', 1)
 let g:gutentags_add_default_project_roots = get(g:, 'gutentags_add_default_project_roots', 1)
 let g:gutentags_project_root = get(g:, 'gutentags_project_root', [])
 if g:gutentags_add_default_project_roots