vim-signify/autoload/sy/debug.vim
James McCoy c9007b894b Use 1-based indexing for buffer ranges
`:SyDebug` is displaying info if an alternate buffer is set.  This
occurs because a buffer number of 0 represents the alternate buffer.
Using a 1-based range in sy#debug#list_active_buffers fixes this.

Signed-off-by: James McCoy <vega.james@gmail.com>

References #97.
2013-11-22 20:51:37 +01:00

21 lines
487 B
VimL

" vim: et sw=2 sts=2
scriptencoding utf-8
" Function: #list_active_buffers {{{1
function! sy#debug#list_active_buffers() abort
for b in range(1, bufnr('$'))
if !buflisted(b) || empty(getbufvar(b, 'sy'))
continue
endif
let sy = copy(getbufvar(b, 'sy'))
let path = remove(sy, 'path')
echo "\n". path ."\n". repeat('=', strlen(path))
for stat in sort(keys(sy))
echo printf("%20s = %s\n", stat, string(sy[stat]))
endfor
endfor
endfunction