From 467b194d4b73341c688d12d4a87ea908c5ec0936 Mon Sep 17 00:00:00 2001 From: Kien N Date: Sat, 10 Sep 2011 19:51:49 +0700 Subject: [PATCH] correctly deletes inner word --- autoload/ctrlp.vim | 8 +++++--- doc/ctrlp.txt | 18 +++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index e136ecb..c30c41d 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -70,7 +70,7 @@ else endif if !exists('g:ctrlp_use_caching') - let s:caching = 0 + let s:caching = 1 else let s:caching = g:ctrlp_use_caching unl g:ctrlp_use_caching @@ -525,8 +525,10 @@ func! s:PrtDeleteWord() let s:nomatches = 1 let prt = g:CtrlP_prompt let str = prt[0] - if match(str, ' [^ ]\+$') >= 0 - let str = matchstr(str, '^.\+ \ze[^ ]\+$') + if match(str, '\W\w\+$') >= 0 + let str = matchstr(str, '^.\+\W\ze\w\+$') + elseif match(str, '\w\W\+$') >= 0 + let str = matchstr(str, '^.\+\w\ze\W\+$') elseif match(str, '[ ]\+$') >= 0 let str = matchstr(str, '^.*[^ ]\+\ze[ ]\+$') elseif match(str, ' ') <= 0 diff --git a/doc/ctrlp.txt b/doc/ctrlp.txt index d049805..b65c735 100644 --- a/doc/ctrlp.txt +++ b/doc/ctrlp.txt @@ -109,19 +109,19 @@ Set this to 1 to set full |regexp| search as the default mode: > let g:ctrlp_regexp_search = 0 < + *'g:ctrlp_use_caching'* +Set this to 0 to disable cross-sessions caching (flat files). When disabled, +it’ll still be enabled if the working directory has more than 4000 files: > + let g:ctrlp_use_caching = 1 +< + *'g:ctrlp_cache_dir'* Set the parent directory for the '.ctrlp_cache' directory: > let g:ctrlp_cache_dir = $HOME < - *'g:ctrlp_use_caching'* -Set this to 1 to always enable caching (flat files). Caching’s also temporarily -enabled if the working directory has more than 4000 files: > - let g:ctrlp_use_caching = 0 -< - *'g:ctrlp_by_filename'* -Set this to 1 to set search by file-name (not full path) as the default: > +Set this to 1 to set search by filename (not full path) as the default: > let g:ctrlp_by_filename = 0 < @@ -301,7 +301,7 @@ Once inside the prompt: Open selected file in a 'horizontal' split - Refresh the match window. + Refresh the match window and clear the cache. , , @@ -354,7 +354,7 @@ CHANGELOG *ctrlp-update-2* Update #2~ + Extended the behavior of |g:ctrlp_persistent_input| - + New option: |g:ctrlp_dotfiles| + + New options: |g:ctrlp_dotfiles| + New input format: '..' (section 5.d) + New mapping: . + New commands: |:CtrlPCurWD|,