From 5060d0b816b807a1a7b2d5abe5abb5ba2d57967e Mon Sep 17 00:00:00 2001 From: David Ibia Date: Fri, 14 Jun 2024 02:25:56 +0100 Subject: [PATCH] feat(lualine.lua): add function IsMoltenActive to check if Molten plugin is active and display corresponding status line configuration --- lua/absolute/after/lualine.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lua/absolute/after/lualine.lua b/lua/absolute/after/lualine.lua index fedd58d..28ed800 100644 --- a/lua/absolute/after/lualine.lua +++ b/lua/absolute/after/lualine.lua @@ -89,6 +89,19 @@ function IsPoetvActive() end end +function IsMoltenActive() + -- Check if molten is active + -- If molten is active, then return true + + -- Check if vim.fn.MoltenStatusLineInit is a function + + if vim.fn.exists("*MoltenStatusLineInit") == 1 then + return molten_status.initialized + else + return false + end +end + -- configure lualine with modified theme lualine.setup({ options = { @@ -101,11 +114,10 @@ lualine.setup({ cond = IsFlutterToolsActive, color = { fg = "#ff9e64" }, }, - { - molten_status.initialized, - }, { molten_status.kernels, + cond = IsMoltenActive, + color = { fg = "#ff9e64" }, }, { GetPoetvStatusLine,