feat(lualine.lua): add function IsMoltenActive to check if Molten plugin is active and display corresponding status line configuration

This commit is contained in:
David Ibia
2024-06-14 02:25:56 +01:00
parent 2b7ce8f520
commit 5060d0b816

View File

@@ -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,