From b4d0a5ddf858c26b6d7fca1b242190b2fe30e95f Mon Sep 17 00:00:00 2001 From: Suyashtnt Date: Thu, 23 Jun 2022 20:23:33 +0200 Subject: [PATCH 1/4] feat: add leap support --- lua/catppuccin/config.lua | 1 + lua/catppuccin/core/integrations/leap.lua | 38 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 lua/catppuccin/core/integrations/leap.lua diff --git a/lua/catppuccin/config.lua b/lua/catppuccin/config.lua index db44af1..aef27e4 100644 --- a/lua/catppuccin/config.lua +++ b/lua/catppuccin/config.lua @@ -64,6 +64,7 @@ config.options = { bufferline = true, markdown = true, lightspeed = false, + leap = false, ts_rainbow = false, hop = false, notify = true, diff --git a/lua/catppuccin/core/integrations/leap.lua b/lua/catppuccin/core/integrations/leap.lua new file mode 100644 index 0000000..ae84e99 --- /dev/null +++ b/lua/catppuccin/core/integrations/leap.lua @@ -0,0 +1,38 @@ +local M = {} + +local is_prepared + +local function set_prepared(val) + is_prepared = val +end + +local function get_prepared() + return is_prepared +end + +function M.get(cp) + + if not get_prepared() then + local catppuccin = require("catppuccin") + if catppuccin.after_loading ~= nil then + catppuccin.after_loading = function () + catppuccin.after_loading() + require'leap'.init_highlight(true) + end + else + catppuccin.after_loading = function () + require'leap'.init_highlight(true) + end + end + set_prepared(true) + end + + return { + LeapLabelPrimary = {bg = cp.surface1, fg = cp.text}, + LeapLabelSecondary = {bg = cp.surface1, fg = cp.text}, + LeapBackdrop = {bg = cp.base, fg = cp.overlay0}, + LeapMatch = {bg = cp.base, fg = cp.red, style = "underline"}, + } +end + +return M From 1668fcfd2c8510aa0668ba6ce393a40354ee4cd8 Mon Sep 17 00:00:00 2001 From: Suyashtnt Date: Thu, 23 Jun 2022 20:27:53 +0200 Subject: [PATCH 2/4] fix: attempt to fix nil issue --- lua/catppuccin/core/integrations/leap.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/catppuccin/core/integrations/leap.lua b/lua/catppuccin/core/integrations/leap.lua index ae84e99..d346df2 100644 --- a/lua/catppuccin/core/integrations/leap.lua +++ b/lua/catppuccin/core/integrations/leap.lua @@ -17,11 +17,11 @@ function M.get(cp) if catppuccin.after_loading ~= nil then catppuccin.after_loading = function () catppuccin.after_loading() - require'leap'.init_highlight(true) + require'leap'.init_highlight() end else catppuccin.after_loading = function () - require'leap'.init_highlight(true) + require'leap'.init_highlight() end end set_prepared(true) From a3ed55196891ab3ad4cf416515bcabb1d7c21960 Mon Sep 17 00:00:00 2001 From: Suyashtnt Date: Thu, 23 Jun 2022 20:29:02 +0200 Subject: [PATCH 3/4] fix: attempt to fix nil issue again --- lua/catppuccin/core/integrations/leap.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/catppuccin/core/integrations/leap.lua b/lua/catppuccin/core/integrations/leap.lua index d346df2..db7a629 100644 --- a/lua/catppuccin/core/integrations/leap.lua +++ b/lua/catppuccin/core/integrations/leap.lua @@ -17,11 +17,11 @@ function M.get(cp) if catppuccin.after_loading ~= nil then catppuccin.after_loading = function () catppuccin.after_loading() - require'leap'.init_highlight() + -- require'leap'.init_highlight() end else catppuccin.after_loading = function () - require'leap'.init_highlight() + -- require'leap'.init_highlight() end end set_prepared(true) From 50ad531d96ae85c4c30798e3a9b8ed5a8ae92922 Mon Sep 17 00:00:00 2001 From: Suyashtnt Date: Thu, 23 Jun 2022 20:37:09 +0200 Subject: [PATCH 4/4] fix: attempt number 4 at fixing leap --- lua/catppuccin/core/integrations/leap.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/catppuccin/core/integrations/leap.lua b/lua/catppuccin/core/integrations/leap.lua index db7a629..ae84e99 100644 --- a/lua/catppuccin/core/integrations/leap.lua +++ b/lua/catppuccin/core/integrations/leap.lua @@ -17,11 +17,11 @@ function M.get(cp) if catppuccin.after_loading ~= nil then catppuccin.after_loading = function () catppuccin.after_loading() - -- require'leap'.init_highlight() + require'leap'.init_highlight(true) end else catppuccin.after_loading = function () - -- require'leap'.init_highlight() + require'leap'.init_highlight(true) end end set_prepared(true)