# HG changeset patch # User Ludovic Chabant # Date 1552539379 25200 # Node ID d3f9a92399d194554276447f9b6cd1372d3c1b64 # Parent 050d0549ecf35110c10d248002ec18537367a50e Separate the default project marker finder into a function. This lets people who write custom marker finders fallback to the default behaviour if needed. diff -r 050d0549ecf3 -r d3f9a92399d1 autoload/gutentags.vim --- a/autoload/gutentags.vim Tue Mar 12 21:43:50 2019 -0700 +++ b/autoload/gutentags.vim Wed Mar 13 21:56:19 2019 -0700 @@ -184,7 +184,13 @@ if g:gutentags_project_root_finder != '' return call(g:gutentags_project_root_finder, [a:path]) endif + return gutentags#default_get_project_root(a:path) +endfunction +" Default implementation for finding project markers... useful when a custom +" finder (`g:gutentags_project_root_finder`) wants to fallback to the default +" behaviour. +function! gutentags#default_get_project_root(path) abort let l:path = gutentags#stripslash(a:path) let l:previous_path = "" let l:markers = g:gutentags_project_root[:] diff -r 050d0549ecf3 -r d3f9a92399d1 doc/gutentags.txt --- a/doc/gutentags.txt Tue Mar 12 21:43:50 2019 -0700 +++ b/doc/gutentags.txt Wed Mar 13 21:56:19 2019 -0700 @@ -384,8 +384,11 @@ argument (the path to the current buffer's file) and returns a string value (the project's root directory). Defaults to `''`. - Note: when set, the called implementation will most - likely ignore |g:gutentags_project_root|. + Note: when set, the called implementation will + possibly ignore |g:gutentags_project_root|. + Note: an implementation can fallback to the default + behaviour by calling + `gutentags#default_get_project_root`. *gutentags_generate_on_missing* g:gutentags_generate_on_missing