optional root markers
This commit is contained in:
parent
5ae7572934
commit
8d1ec536d3
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user