diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index 8de2864..1cba156 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -631,7 +631,7 @@ func! ctrlp#SetWorkingPath(...) se noacd endif sil! exe 'chdir' fnameescape(expand('%:p:h')) - if s:pathmode || l:pathmode | retu | endif + if s:pathmode == 1 || l:pathmode == 1 | retu | endif let markers = [ \ 'root.dir', \ '.vimprojects', @@ -640,6 +640,11 @@ func! ctrlp#SetWorkingPath(...) \ '.hg/', \ '.bzr/', \ ] + if exists('g:ctrlp_root_markers') + \ && type(g:ctrlp_root_markers) == 3 + \ && !empty(g:ctrlp_root_markers) + let markers = g:ctrlp_root_markers + endif for marker in markers sil! cal s:FindRoot(getcwd(), marker) if getcwd() != expand('%:p:h') | break | endif diff --git a/doc/ctrlp.txt b/doc/ctrlp.txt index 6b693c9..b362305 100644 --- a/doc/ctrlp.txt +++ b/doc/ctrlp.txt @@ -92,6 +92,12 @@ to your |.vimrc|; the parameter is the same (1, 2 and 0): > au BufEnter * cal ctrlp#SetWorkingPath(2) < + *'g:ctrlp_root_markers'* +Use this to set your own root markers for the SetWorkingPath() function instead +of the default ones: > + let g:ctrlp_root_markers = [''] +< + *'g:ctrlp_max_height'* Set the maximum height of the match window: > let g:ctrlp_max_height = 10