This commit is contained in:
Olivier Roques
2020-12-28 16:55:23 +01:00
parent 1076f7f317
commit 17f4213165
3 changed files with 10 additions and 13 deletions

View File

@@ -37,13 +37,12 @@ local function to_section(buffer)
if buffer.flags.readonly then table.insert(flags, '[RO]') end
flags = table.concat(flags)
item = flags == '' and item or string.format('%s %s', item, flags)
local section = {
return {
class = 'bufferline',
item = string.format(' %s ', item),
modified = buffer.flags.modified,
current = buffer.current,
}
return section
end
local function get_buffers()
@@ -53,12 +52,12 @@ local function get_buffers()
table.insert(buffers, {
bufnr = nr,
name = fn.fnamemodify(fn.bufname(nr), ':t'),
current = nr == fn.bufnr('%'),
flags = {
modified = fn.getbufvar(nr, '&modified') == 1,
modifiable = fn.getbufvar(nr, '&modifiable') == 1,
readonly = fn.getbufvar(nr, '&readonly') == 1,
},
current = nr == fn.bufnr('%'),
})
end
end