Skip to content

Commit

Permalink
Revert "Move the completion function"
Browse files Browse the repository at this point in the history
This reverts commit 3c61823.

Revert "Use a custom completion function"

This reverts commit bedfa3b.
  • Loading branch information
kien committed Mar 22, 2013
1 parent fe19bac commit 7037f92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
10 changes: 0 additions & 10 deletions autoload/ctrlp/utils.vim
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,6 @@ fu! ctrlp#utils#fnesc(path, type, ...)
en
retu a:0 ? escape(path, a:1) : path
endf

fu! ctrlp#utils#dircompl(...)
let [hsl, str] = [match(a:1, '[\/]'), '']
let par = substitute(a:1, '[^\/]*$', '', '')
let path = !hsl ? par : hsl > 0 ? getcwd().s:lash().par : getcwd()
for dir in split(globpath(ctrlp#utils#fnesc(path, 'g', ','), '*/'), '\n')
let str .= par.split(dir, '[\/]')[-1]."\n"
endfo
retu str
endf
"}}}

" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
11 changes: 4 additions & 7 deletions plugin/ctrlp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ let [g:ctrlp_lines, g:ctrlp_allfiles, g:ctrlp_alltags, g:ctrlp_alldirs,
if !exists('g:ctrlp_map') | let g:ctrlp_map = '<c-p>' | en
if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en

com! -n=? -com=custom,ctrlp#utils#dircompl CtrlP
\ cal ctrlp#init(0, { 'dir': <q-args> })

com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPMRUFiles
\ cal ctrlp#init(2, { 'dir': <q-args> })
com! -n=? -com=dir CtrlP cal ctrlp#init(0, { 'dir': <q-args> })
com! -n=? -com=dir CtrlPMRUFiles cal ctrlp#init(2, { 'dir': <q-args> })

com! -bar CtrlPBuffer cal ctrlp#init(1)
com! -n=? CtrlPLastMode cal ctrlp#init(-1, { 'args': <q-args> })
Expand All @@ -45,7 +42,7 @@ cal ctrlp#mrufiles#init()
com! -bar CtrlPTag cal ctrlp#init(ctrlp#tag#id())
com! -bar CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id())

com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPDir
com! -n=? -com=dir CtrlPDir
\ cal ctrlp#init(ctrlp#dir#id(), { 'dir': <q-args> })

com! -n=? -com=buffer CtrlPBufTag
Expand All @@ -63,7 +60,7 @@ com! -bar CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1))
com! -bar CtrlPMixed cal ctrlp#init(ctrlp#mixed#id())
com! -bar CtrlPBookmarkDir cal ctrlp#init(ctrlp#bookmarkdir#id())

com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPBookmarkDirAdd
com! -n=? -com=dir CtrlPBookmarkDirAdd
\ cal ctrlp#call('ctrlp#bookmarkdir#add', <q-args>)

" vim:ts=2:sw=2:sts=2

0 comments on commit 7037f92

Please sign in to comment.