From eba121cc651413d753f688162413008a6ed455e2 Mon Sep 17 00:00:00 2001 From: LostNeophyte Date: Wed, 25 Jan 2023 11:06:39 +0100 Subject: refactor: use callbacks for configuring builtins --- lua/lvim/core/alpha.lua | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'lua/lvim/core/alpha.lua') diff --git a/lua/lvim/core/alpha.lua b/lua/lvim/core/alpha.lua index 42159d70..81bff949 100644 --- a/lua/lvim/core/alpha.lua +++ b/lua/lvim/core/alpha.lua @@ -1,23 +1,21 @@ local M = {} function M.config() - local lazy_set = require("lvim.utils.modules").lazy_set - local lvim_dashboard = lazy_set("lvim.core.alpha.dashboard", "get_sections") - local lvim_startify = lazy_set("lvim.core.alpha.startify", "get_sections") - lvim.builtin.alpha = { + local config = { dashboard = { config = {}, - section = lvim_dashboard, + section = require("lvim.core.alpha.dashboard").get_sections(), opts = { autostart = true }, }, startify = { config = {}, - section = lvim_startify, + section = require("lvim.core.alpha.startify").get_sections(), opts = { autostart = true }, }, - active = true, mode = "dashboard", } + ---@cast config +LvimBuiltin + lvim.builtin.alpha = config end local function resolve_buttons(theme_name, button_section) @@ -75,14 +73,6 @@ local function configure_additional_autocmds() pattern = "alpha", command = "set showtabline=0 | autocmd BufLeave set showtabline=" .. vim.opt.showtabline._value, }) - if not lvim.builtin.lualine.options.globalstatus then - -- https://github.com/goolord/alpha-nvim/issues/42 - vim.api.nvim_create_autocmd("FileType", { - group = group, - pattern = "alpha", - command = "set laststatus=0 | autocmd BufUnload set laststatus=" .. vim.opt.laststatus._value, - }) - end end function M.setup() -- cgit v1.2.3