parent
370ac18b3b
commit
3453b0d473
@ -334,7 +334,7 @@ fu! s:MatchedItems(items, pat, limit)
|
|||||||
retu newitems
|
retu newitems
|
||||||
endf
|
endf
|
||||||
fu! s:SplitPattern(str) "{{{1
|
fu! s:SplitPattern(str) "{{{1
|
||||||
let str = s:sanstail(a:str)
|
let str = a:str
|
||||||
if s:migemo && s:regexp && len(str) > 0 && executable('cmigemo')
|
if s:migemo && s:regexp && len(str) > 0 && executable('cmigemo')
|
||||||
let str = s:migemo(str)
|
let str = s:migemo(str)
|
||||||
en
|
en
|
||||||
@ -402,16 +402,14 @@ endf
|
|||||||
fu! s:Update(str)
|
fu! s:Update(str)
|
||||||
" Get the previous string if existed
|
" Get the previous string if existed
|
||||||
let oldstr = exists('s:savestr') ? s:savestr : ''
|
let oldstr = exists('s:savestr') ? s:savestr : ''
|
||||||
let pat = s:SplitPattern(a:str)
|
|
||||||
" Get the new string sans tail
|
" Get the new string sans tail
|
||||||
let notail = substitute(a:str, '\\\\', '\', 'g')
|
let str = s:sanstail(a:str)
|
||||||
let notail = substitute(notail, '\\\@<!:\([^:]\|\\:\)*$', '', '')
|
|
||||||
let notail = substitute(notail, '\\\ze:', '', 'g')
|
|
||||||
" Stop if the string's unchanged
|
" Stop if the string's unchanged
|
||||||
if notail == oldstr && !empty(notail) && !exists('s:force')
|
if str == oldstr && !empty(str) && !exists('s:force')
|
||||||
retu
|
retu
|
||||||
en
|
en
|
||||||
let lines = exists('g:ctrlp_nolimit') && empty(notail) ? copy(g:ctrlp_lines)
|
let pat = s:SplitPattern(str)
|
||||||
|
let lines = exists('g:ctrlp_nolimit') && empty(str) ? copy(g:ctrlp_lines)
|
||||||
\ : s:MatchedItems(g:ctrlp_lines, pat, s:mxheight)
|
\ : s:MatchedItems(g:ctrlp_lines, pat, s:mxheight)
|
||||||
cal s:Render(lines, pat)
|
cal s:Render(lines, pat)
|
||||||
endf
|
endf
|
||||||
@ -1365,7 +1363,7 @@ fu! s:openfile(cmd, filpath, ...)
|
|||||||
let cmd = a:cmd =~ '^[eb]$' && &modified ? 'hid '.a:cmd : a:cmd
|
let cmd = a:cmd =~ '^[eb]$' && &modified ? 'hid '.a:cmd : a:cmd
|
||||||
let cmd = cmd =~ '^tab' ? tabpagenr('$').cmd : cmd
|
let cmd = cmd =~ '^tab' ? tabpagenr('$').cmd : cmd
|
||||||
let tail = a:0 ? a:1 : s:tail()
|
let tail = a:0 ? a:1 : s:tail()
|
||||||
sil! exe cmd.tail.' '.ctrlp#fnesc(a:filpath)
|
exe cmd.tail.' '.ctrlp#fnesc(a:filpath)
|
||||||
if !empty(tail)
|
if !empty(tail)
|
||||||
sil! norm! zvzz
|
sil! norm! zvzz
|
||||||
en
|
en
|
||||||
|
@ -45,7 +45,7 @@ fu! ctrlp#quickfix#accept(mode, str)
|
|||||||
let cmd = md == 't' ? 'tabe' : md == 'h' ? 'new' : md == 'v' ? 'vne'
|
let cmd = md == 't' ? 'tabe' : md == 'h' ? 'new' : md == 'v' ? 'vne'
|
||||||
\ : ctrlp#normcmd('e')
|
\ : ctrlp#normcmd('e')
|
||||||
let cmd = cmd == 'e' && &modified ? 'hid e' : cmd
|
let cmd = cmd == 'e' && &modified ? 'hid e' : cmd
|
||||||
sil! exe cmd.' '.ctrlp#fnesc(filpath)
|
exe cmd.' '.ctrlp#fnesc(filpath)
|
||||||
cal cursor(items[2], items[3]) | sil! norm! zvzz
|
cal cursor(items[2], items[3]) | sil! norm! zvzz
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
@ -97,9 +97,9 @@ fu! ctrlp#tag#accept(mode, str)
|
|||||||
if cmd != ''
|
if cmd != ''
|
||||||
sil! exe cmd
|
sil! exe cmd
|
||||||
en
|
en
|
||||||
sil! exe fnd[1].'ta' tg
|
exe fnd[1].'ta' tg
|
||||||
el
|
el
|
||||||
sil! exe cmd.' '.tg
|
exe cmd.' '.tg
|
||||||
en
|
en
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user