Permalink
Browse files

Display some status indicators in Buffer mode

Closes #283
  • Loading branch information...
1 parent 3c61823 commit 1757bade7824a5a4e849d9f7d7d42e6cabe9d8d2 @zah zah committed with Sep 20, 2012
Showing with 12 additions and 2 deletions.
  1. +11 −2 autoload/ctrlp.vim
  2. +1 −0 doc/ctrlp.txt
View
@@ -1303,8 +1303,17 @@ endf
" *** Paths {{{2
" Line formatting {{{3
fu! s:formatline(str)
- let cond = s:ispath && ( s:winw - 4 ) < s:strwidth(a:str)
- retu '> '.( cond ? s:pathshorten(a:str) : a:str )
+ let str = a:str
+ if s:itemtype == 1
+ let bfnr = bufnr('^'.fnamemodify(str, ':p').'$')
+ let idc = ( bfnr == bufnr('#') ? '#' : '' )
+ \ . ( getbufvar(bfnr, '&ma') ? '' : '-' )
+ \ . ( getbufvar(bfnr, '&ro') ? '=' : '' )
+ \ . ( getbufvar(bfnr, '&mod') ? '+' : '' )
+ let str .= idc != '' ? ' '.idc : ''
+ en
+ let cond = s:ispath && ( s:winw - 4 ) < s:strwidth(str)
+ retu '> '.( cond ? s:pathshorten(str) : str )
endf
fu! s:pathshorten(str)
View
@@ -1240,6 +1240,7 @@ Special thanks:~
* Seth Fowler <github.com/sfowler>
* Lowe Thiderman <github.com/thiderman>
* Christopher Fredén <github.com/icetan>
+ * Zahary Karadjov <github.com/zah>
===============================================================================
CHANGELOG *ctrlp-changelog*

0 comments on commit 1757bad

Please sign in to comment.