Fix jumping to a line

Close #135
This commit is contained in:
Kien N 2012-02-09 08:00:33 +07:00
parent 75e31e9341
commit 370ac18b3b

View File

@ -402,6 +402,7 @@ endf
fu! s:Update(str)
" Get the previous string if existed
let oldstr = exists('s:savestr') ? s:savestr : ''
let pat = s:SplitPattern(a:str)
" Get the new string sans tail
let notail = substitute(a:str, '\\\\', '\', 'g')
let notail = substitute(notail, '\\\@<!:\([^:]\|\\:\)*$', '', '')
@ -410,7 +411,6 @@ fu! s:Update(str)
if notail == oldstr && !empty(notail) && !exists('s:force')
retu
en
let pat = s:SplitPattern(a:str)
let lines = exists('g:ctrlp_nolimit') && empty(notail) ? copy(g:ctrlp_lines)
\ : s:MatchedItems(g:ctrlp_lines, pat, s:mxheight)
cal s:Render(lines, pat)
@ -1147,7 +1147,7 @@ fu! s:highlight(pat, grp)
if s:byfname
" Match only filename
let pat = substitute(pat, '\[\^\(.\{-}\)\]\\{-}', '[^\\/\1]\\{-}', 'g')
let pat = substitute(pat, '$', '\\ze[^\\/]*$', 'g')
let pat = substitute(pat, '\$\@<!$', '\\ze[^\\/]*$', 'g')
en
cal matchadd(a:grp, '\c'.pat)
if hlexists('CtrlPLinePre')