From 876295ec028ed345e5d9162b0b0c3e5775979fb7 Mon Sep 17 00:00:00 2001 From: siduck Date: Sat, 25 Jun 2022 11:21:50 +0530 Subject: [PATCH] rm misleading field name for tabufline in default_config --- lua/core/default_config.lua | 6 +++--- lua/core/init.lua | 4 ++-- lua/core/lazy_load.lua | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index e5e0dd9..48203d1 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -1,5 +1,4 @@ --- IMPORTANT NOTE : This is default config, so dont change anything here. --- chadrc overrides this file +-- Chadrc overrides this file local M = {} @@ -28,7 +27,8 @@ M.ui = { override = {}, }, - tabufline_enabled = true, + -- lazyload it when there are 1+ buffers + tabufline_lazyloaded = true, } M.plugins = { diff --git a/lua/core/init.lua b/lua/core/init.lua index 709f878..7fdf605 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -38,7 +38,7 @@ autocmd("BufEnter", { vim.t.bufs = vim.api.nvim_list_bufs() --- thx to https://github.com/ii14 && stores buffer per tab -> table +-- thx to https://github.com/ii14 & stores buffer per tab -> table autocmd({ "BufAdd" }, { callback = function(args) if vim.t.bufs == nil then @@ -72,7 +72,7 @@ autocmd("BufDelete", { end, }) -if require("core.utils").load_config().ui.tabufline_enabled then +if require("core.utils").load_config().ui.tabufline_lazyloaded then require("core.lazy_load").tabufline() else vim.opt.showtabline = 2 diff --git a/lua/core/lazy_load.lua b/lua/core/lazy_load.lua index 8712f68..873b593 100644 --- a/lua/core/lazy_load.lua +++ b/lua/core/lazy_load.lua @@ -116,8 +116,6 @@ M.tabufline = function() vim.opt.showtabline = 2 vim.opt.tabline = "%!v:lua.require('ui.tabline').run()" vim.api.nvim_del_augroup_by_name "TabuflineLazyLoad" - else - return "" end end, })