Option to clear the marks

This commit is contained in:
Kien N 2012-05-31 16:54:54 +07:00
parent fcda2e4d59
commit 6a9fda9304
2 changed files with 18 additions and 9 deletions

View File

@ -979,8 +979,13 @@ fu! s:OpenMulti(...)
let md = a:0 ? a:1 : ( md == '' ? 'v' : md )
let nopt = exists('g:ctrlp_open_multiple_files')
if s:argmap && !a:0
let md = s:argmaps(md)
if md == 'cancel' | retu | en
let md = s:argmaps(md, 0)
if md == 'c'
cal s:unmarksigns()
unl! s:marked
cal s:BuildPrompt(0)
en
if md =~ '\v^c(ancel)?$' | retu | en
let nr = nr == '0' ? ( nopt ? '' : '1' ) : nr
en
let mkd = values(s:marked)
@ -1520,11 +1525,13 @@ fu! s:sanstail(str)
retu substitute(str, '\\\ze:', '', 'g')
endf
fu! s:argmaps(md, ...)
let roh = a:0 ? ['/[r]eplace', 'r'] : ['/h[i]dden', 'i']
let str = '[t]ab/[v]ertical/[h]orizontal'.roh[0].'? '
let args = [a:md] + ( a:0 ? [a:1] : [] )
retu s:choices(str, ['t', 'v', 'h', roh[1]], 's:argmaps', args)
fu! s:argmaps(md, i)
let roh = [
\ ['OpenMulti', '/h[i]dden/[c]lear', ['i', 'c']],
\ ['CreateNewFile', '/[r]eplace', ['r']],
\ ]
let str = roh[a:i][0].': [t]ab/[v]ertical/[h]orizontal'.roh[a:i][1].'? '
retu s:choices(str, ['t', 'v', 'h'] + roh[a:i][2], 's:argmaps', [a:md, a:i])
endf
fu! s:insertstr()

View File

@ -313,8 +313,10 @@ Pressing <c-o> or <c-y> will then prompt for a keypress. The key can be:
t - open in tab(s)
h - open in horizontal split(s)
v - open in vertical split(s)
r - open in current window (for <c-y> only)
<esc>, <c-c>, <c-g> - cancel and go back to the prompt.
i - open as hidden buffers (for <c-o> only)
c - clear the marked files (for <c-o> only)
r - open in the current window (for <c-y> only)
<esc>, <c-c>, <c-u> - cancel and go back to the prompt.
<cr> - use the default behavior specified with |g:ctrlp_open_new_file| and
|g:ctrlp_open_multiple_files|.