From 92b8c399ddd6ec35a1b8a484bf1a2889c458f86b Mon Sep 17 00:00:00 2001 From: Kien N Date: Wed, 22 Feb 2012 00:41:08 +0700 Subject: [PATCH] Support of per buffer working path mode Close #145 --- autoload/ctrlp.vim | 4 +++- doc/ctrlp.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index 4558abd..5214e38 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -689,7 +689,7 @@ fu! s:PrtSwitcher() unl s:force endf fu! s:SetWD(...) "{{{1 - let pathmode = s:pathmode + let pathmode = s:wpmode if a:0 && strlen(a:1) | if type(a:1) cal ctrlp#setdir(a:1) | retu el @@ -1338,6 +1338,8 @@ fu! s:getenv() let [s:winh, s:crcursor] = [min([s:mxheight, &lines]), getpos('.')] let [s:crbufnr, s:crvisual] = [bufnr('%'), s:lastvisual()] let s:currwin = s:mwbottom ? winnr() : winnr() + has('autocmd') + let s:wpmode = exists('b:ctrlp_working_path_mode') + \ ? b:ctrlp_working_path_mode : s:pathmode if exists('g:ctrlp_extensions') if index(g:ctrlp_extensions, 'undo') >= 0 \ && v:version > 702 && has('patch005') && exists('*undotree') diff --git a/doc/ctrlp.txt b/doc/ctrlp.txt index 847f794..ba2730e 100644 --- a/doc/ctrlp.txt +++ b/doc/ctrlp.txt @@ -97,6 +97,7 @@ variable: > .bzr/ _darcs/ 0 - don’t manage working directory. +Use b:ctrlp_working_path_mode (a |b:var|) to set this option for each buffer. *'g:ctrlp_root_markers'* Use this to set your own root markers in addition to the default ones. Your