Commits

kien  committed 3d030d0 Draft

Correct a highlighting description [...]

Display some status indicators in Buffer mode

  • Participants
  • Parent commits d589d82

Comments (0)

Files changed (2)

File autoload/ctrlp.vim

 " *** 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)

File doc/ctrlp.txt

 
 Statuslines:~
   * Highlight groups:
-    CtrlPMode1 : 'prt' or 'win', also for 'regex' (Character)
-    CtrlPMode2 : 'file' or 'path', also for the local working dir (|hl-LineNr|)
+    CtrlPMode1 : 'file' or 'path', and the current mode (Character)
+    CtrlPMode2 : 'prt' or 'win', 'regex', the working directory (|hl-LineNr|)
     CtrlPStats : the scanning status (Function)
 
   For rebuilding the statuslines, see |g:ctrlp_status_func|.
     * Seth Fowler <github.com/sfowler>
     * Lowe Thiderman <github.com/thiderman>
     * Christopher Fredén <github.com/icetan>
+    * Zahary Karadjov <github.com/zah>
 
 ===============================================================================
 CHANGELOG                                                     *ctrlp-changelog*