From dffc1ee832a10bde73c182d59a630458b24b1204 Mon Sep 17 00:00:00 2001 From: Olivier Roques Date: Tue, 9 Feb 2021 10:29:26 +0100 Subject: [PATCH] Fix highlighting --- lua/hardline.lua | 2 +- lua/hardline/bufferline.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/hardline.lua b/lua/hardline.lua index a1fa2c1..ada543a 100644 --- a/lua/hardline.lua +++ b/lua/hardline.lua @@ -113,7 +113,7 @@ local function get_section_state(section) end return state end - return '' + return common.is_active() and 'active' or 'inactive' end local function highlight_section(section) diff --git a/lua/hardline/bufferline.lua b/lua/hardline/bufferline.lua index cad0638..83ae521 100644 --- a/lua/hardline/bufferline.lua +++ b/lua/hardline/bufferline.lua @@ -1,7 +1,7 @@ local fn, vim = vim.fn, vim local fmt = string.format -local function exclude(bufnr) +local function is_excluded(bufnr) return fn.buflisted(bufnr) == 0 or fn.getbufvar(bufnr, '&filetype') == 'qf' end @@ -61,7 +61,7 @@ end local function get_buffers() local buffers = {} for nr = 1, fn.bufnr('$') do - if not exclude(nr) then + if not is_excluded(nr) then table.insert(buffers, { bufnr = nr, name = fn.fnamemodify(fn.bufname(nr), ':t'),