From b024a12bc841862088f175a29ba71af704ec6c34 Mon Sep 17 00:00:00 2001 From: Romanov Yuri Date: Tue, 2 Jul 2024 18:47:38 +0700 Subject: [PATCH 1/2] feat: add icons config --- lua/kulala/config/init.lua | 7 +++++++ lua/kulala/inlay/init.lua | 6 ++++-- lua/lualine/components/kulala.lua | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lua/kulala/config/init.lua b/lua/kulala/config/init.lua index b3ee33b..9763fe7 100644 --- a/lua/kulala/config/init.lua +++ b/lua/kulala/config/init.lua @@ -11,6 +11,13 @@ KULALA_CONFIG = KULALA_CONFIG or { json = { "jq", "." }, xml = { "xmllint", "--format", "-" }, html = { "xmllint", "--format", "--html", "-" }, + }, + inlay = { + loading_icon = "⏳", + done_icon = "✅ " + }, + lualine = { + icon = "🐼" } } diff --git a/lua/kulala/inlay/init.lua b/lua/kulala/inlay/init.lua index 286b635..4e036bb 100644 --- a/lua/kulala/inlay/init.lua +++ b/lua/kulala/inlay/init.lua @@ -1,4 +1,6 @@ local NS = vim.api.nvim_create_namespace('jest.nvim') +local CONFIG = require("kulala.config") +local CFG = CONFIG.get_config() local M = {} @@ -12,11 +14,11 @@ M.clear = function() end M.show_loading = function() - M.show('⏳') + M.show(CFG.inlay.loading_icon) end M.show_done = function(self, elapsed_time) - M.show('✅ ' .. elapsed_time) + M.show(CFG.inlay.done_icon .. elapsed_time) end diff --git a/lua/lualine/components/kulala.lua b/lua/lualine/components/kulala.lua index 3c6e0d4..0bf6733 100644 --- a/lua/lualine/components/kulala.lua +++ b/lua/lualine/components/kulala.lua @@ -1,9 +1,10 @@ local lualine_require = require("lualine_require") local M = lualine_require.require("lualine.component"):extend() +local CONFIG = require("kulala.config") local default_options = { fg = "#10B1FE", - icon = "🐼", + icon = CONFIG.get_config().lualine.icon, } function M:init(options) From 499ee5c17546e988e37d4ec03bc7a7d0d32b1901 Mon Sep 17 00:00:00 2001 From: Romanov Yuri Date: Tue, 2 Jul 2024 20:01:29 +0700 Subject: [PATCH 2/2] refactoring --- lua/kulala/config/init.lua | 12 ++++++------ lua/kulala/inlay/init.lua | 5 ++--- lua/lualine/components/kulala.lua | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lua/kulala/config/init.lua b/lua/kulala/config/init.lua index 9763fe7..3746de7 100644 --- a/lua/kulala/config/init.lua +++ b/lua/kulala/config/init.lua @@ -12,12 +12,12 @@ KULALA_CONFIG = KULALA_CONFIG or { xml = { "xmllint", "--format", "-" }, html = { "xmllint", "--format", "--html", "-" }, }, - inlay = { - loading_icon = "⏳", - done_icon = "✅ " - }, - lualine = { - icon = "🐼" + icons = { + inlay = { + loading = "⏳", + done = "✅ " + }, + lualine = "🐼" } } diff --git a/lua/kulala/inlay/init.lua b/lua/kulala/inlay/init.lua index 4e036bb..76d8dd1 100644 --- a/lua/kulala/inlay/init.lua +++ b/lua/kulala/inlay/init.lua @@ -1,6 +1,5 @@ local NS = vim.api.nvim_create_namespace('jest.nvim') local CONFIG = require("kulala.config") -local CFG = CONFIG.get_config() local M = {} @@ -14,11 +13,11 @@ M.clear = function() end M.show_loading = function() - M.show(CFG.inlay.loading_icon) + M.show(CONFIG.get_config().icons.inlay.loading) end M.show_done = function(self, elapsed_time) - M.show(CFG.inlay.done_icon .. elapsed_time) + M.show(CONFIG.get_config().icons.inlay.done .. elapsed_time) end diff --git a/lua/lualine/components/kulala.lua b/lua/lualine/components/kulala.lua index 0bf6733..d435d81 100644 --- a/lua/lualine/components/kulala.lua +++ b/lua/lualine/components/kulala.lua @@ -4,7 +4,7 @@ local CONFIG = require("kulala.config") local default_options = { fg = "#10B1FE", - icon = CONFIG.get_config().lualine.icon, + icon = CONFIG.get_config().icons.lualine, } function M:init(options)