diff --git a/lua/taken/plugins/lualine.lua b/lua/taken/plugins/lualine.lua index 38bc990..4f9c139 100644 --- a/lua/taken/plugins/lualine.lua +++ b/lua/taken/plugins/lualine.lua @@ -87,6 +87,26 @@ return { return "󰑋 " .. recording_register end end + local function get_buffers() + local bufs = vim.api.nvim_list_bufs() + local bufNumb = 0 + local function buffer_is_valid(buf_id, buf_name) + return 1 == vim.fn.buflisted(buf_id) and buf_name ~= "" + end + for idx = 1, #bufs do + local buf_id = bufs[idx] + local buf_name = vim.api.nvim_buf_get_name(buf_id) + if buffer_is_valid(buf_id, buf_name) then + bufNumb = bufNumb + 1 + end + end + + if bufNumb == 1 then + return bufNumb .. " " + else + return bufNumb .. " " + end + end local mode = { "mode", @@ -199,26 +219,7 @@ return { end, } local buffers = { - function() - local bufs = vim.api.nvim_list_bufs() - local bufNumb = 0 - local function buffer_is_valid(buf_id, buf_name) - return 1 == vim.fn.buflisted(buf_id) and buf_name ~= "" - end - for idx = 1, #bufs do - local buf_id = bufs[idx] - local buf_name = vim.api.nvim_buf_get_name(buf_id) - if buffer_is_valid(buf_id, buf_name) then - bufNumb = bufNumb + 1 - end - end - - if bufNumb == 1 then - return bufNumb .. " " - else - return bufNumb .. " " - end - end, + get_buffers(), color = { fg = colors.darkblue, bg = "None" }, on_click = function() require("buffer_manager.ui").toggle_quick_menu() @@ -260,12 +261,12 @@ return { lualine_z = { location }, }, inactive_sections = { - lualine_a = { "filename" }, + lualine_a = { filename }, lualine_b = {}, lualine_c = {}, lualine_x = {}, lualine_y = {}, - lualine_z = { "location" }, + lualine_z = { location }, }, tabline = {}, extensions = {},