Do not use vim_funcs['bufnr'] for modified_buffers segment

This commit is contained in:
ZyX 2014-09-14 15:44:46 +04:00
parent e7d0c8368e
commit 80db7df959
1 changed files with 7 additions and 4 deletions

View File

@ -470,10 +470,13 @@ def modified_buffers(pl, text='+ ', join_str=','):
:param str join_str:
string to use for joining the modified buffer list
'''
buffer_len = vim_funcs['bufnr']('$')
buffer_mod = [str(bufnr) for bufnr in range(1, buffer_len + 1) if int(getbufvar(bufnr, '&modified') or 0)]
if buffer_mod:
return text + join_str.join(buffer_mod)
buffer_mod_text = join_str.join((
str(buffer.number)
for buffer in vim.buffers
if int(vim_getbufoption({'buffer': buffer, 'bufnr': buffer.number}, 'modified'))
))
if buffer_mod_text:
return text + buffer_mod_text
return None