Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

display buffer modified/readonly status in :CtrlPBuffer

  • Loading branch information...
commit 335877dd228e3dbbfa066f4692fe0abbe5710655 1 parent 3c61823
@zah authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 autoload/ctrlp.vim
View
12 autoload/ctrlp.vim
@@ -405,10 +405,20 @@ fu! s:lsCmd()
en
endf
" - Buffers {{{1
+fu! s:BufStat(buf)
+ if getbufvar(a:buf, "&mod")
+ return " [+]"
+ elseif getbufvar(a:buf, "&ro")
+ return " [R]"
+ else
+ retu ""
+ endif
+endf
+
fu! ctrlp#buffers(...)
let ids = sort(filter(range(1, bufnr('$')), 'empty(getbufvar(v:val, "&bt"))'
\ .' && getbufvar(v:val, "&bl") && strlen(bufname(v:val))'), 's:compmreb')
- retu a:0 && a:1 == 'id' ? ids : map(ids, 'fnamemodify(bufname(v:val), ":.")')
+ retu a:0 && a:1 == 'id' ? ids : map(ids, 'fnamemodify(bufname(v:val), ":.") . s:BufStat(v:val)')
endf
" * MatchedItems() {{{1
fu! s:MatchIt(items, pat, limit, exc)
Please sign in to comment.
Something went wrong with that request. Please try again.