Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions autoload/ctrlp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1762,16 +1762,22 @@ fu! s:formatline2(ct, key, str)
let str .= printf(' %s', parts[3])
en
en
retu s:lineprefix.str
en
let cond = a:ct != 'buf' &&s:ispath && ( s:winw - 4 ) < s:strwidth(str)
let cond = s:ispath && ( s:winw - 4 ) < strchars(str)
retu s:lineprefix.( cond ? s:pathshorten(str) : str )
endf


fu! s:pathshorten(str)
retu matchstr(a:str, '^.\{9}').'...'
\ .matchstr(a:str, '.\{'.( s:winw - 16 ).'}$')
endf
if exists('*strchars') && exists('*strcharpart')
fu! s:pathshorten(str)
retu strcharpart(a:str, 0, 9).'...'.strcharpart(a:str, strchars(a:str) - s:winw + 16)
endf
el
fu! s:pathshorten(str)
retu matchstr(a:str, '^.\{9}').'...'
\ .matchstr(a:str, '.\{'.( s:winw - 16 ).'}$')
endf
en

fu! s:offset(lines, height)
let s:offset = s:mw_order == 'btt' ? ( a:height - s:res_count ) : 0
Expand Down