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 md = a:0 ? a:1 : ( md == '' ? 'v' : md )
let nopt = exists('g:ctrlp_open_multiple_files') let nopt = exists('g:ctrlp_open_multiple_files')
if s:argmap && !a:0 if s:argmap && !a:0
let md = s:argmaps(md) let md = s:argmaps(md, 0)
if md == 'cancel' | retu | en 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 let nr = nr == '0' ? ( nopt ? '' : '1' ) : nr
en en
let mkd = values(s:marked) let mkd = values(s:marked)
@ -1520,11 +1525,13 @@ fu! s:sanstail(str)
retu substitute(str, '\\\ze:', '', 'g') retu substitute(str, '\\\ze:', '', 'g')
endf endf
fu! s:argmaps(md, ...) fu! s:argmaps(md, i)
let roh = a:0 ? ['/[r]eplace', 'r'] : ['/h[i]dden', 'i'] let roh = [
let str = '[t]ab/[v]ertical/[h]orizontal'.roh[0].'? ' \ ['OpenMulti', '/h[i]dden/[c]lear', ['i', 'c']],
let args = [a:md] + ( a:0 ? [a:1] : [] ) \ ['CreateNewFile', '/[r]eplace', ['r']],
retu s:choices(str, ['t', 'v', 'h', roh[1]], 's:argmaps', args) \ ]
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 endf
fu! s:insertstr() 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) t - open in tab(s)
h - open in horizontal split(s) h - open in horizontal split(s)
v - open in vertical split(s) v - open in vertical split(s)
r - open in current window (for <c-y> only) i - open as hidden buffers (for <c-o> only)
<esc>, <c-c>, <c-g> - cancel and go back to the prompt. 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 <cr> - use the default behavior specified with |g:ctrlp_open_new_file| and
|g:ctrlp_open_multiple_files|. |g:ctrlp_open_multiple_files|.