From 44c7ef5568f5377f3d9b5a8b7b267c015ea3205c Mon Sep 17 00:00:00 2001 From: zootedb0t <05kraken@proton.me> Date: Mon, 29 Apr 2024 14:49:28 +0530 Subject: [PATCH] feat(nvim-cmp): update CmpSel highlight fix code format --- lua/citruszest/highlights/init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lua/citruszest/highlights/init.lua b/lua/citruszest/highlights/init.lua index 6c6bda5..096aa2a 100644 --- a/lua/citruszest/highlights/init.lua +++ b/lua/citruszest/highlights/init.lua @@ -5,7 +5,7 @@ local M = {} ---@param a number between 0 and 1 ---@return number local blend = function(c, bg, a) - return math.floor(a * tonumber("0x"..c) + (1 - a) * tonumber("0x"..bg)); + return math.floor(a * tonumber("0x" .. c) + (1 - a) * tonumber("0x" .. bg)) end ---@param hex string hex with 3 channels, ex: #00ff00 @@ -14,15 +14,15 @@ end ---@return string local add_alpha = function(hex, bg, a) if not bg:match("^#%x%x%x%x%x%x$") then - bg = "#121212" + bg = "#121212" end - local r1, g1, b1 = hex:sub(2,3), hex:sub(4,5), hex:sub(6,7) - local r2, g2, b2 = bg:sub(2,3), bg:sub(4,5), bg:sub(6,7) + local r1, g1, b1 = hex:sub(2, 3), hex:sub(4, 5), hex:sub(6, 7) + local r2, g2, b2 = bg:sub(2, 3), bg:sub(4, 5), bg:sub(6, 7) return "#" .. string.format("%02x%02x%02x", blend(r1, r2, a), blend(g1, g2, a), blend(b1, b2, a)) end ----@param C table ----@param O table +---@param C table of colors +---@param O table of option ---@return table M.theme = function(C, O) return { @@ -146,7 +146,7 @@ M.theme = function(C, O) diffFile = { fg = C.cyan }, diffLine = { fg = C.bright_cyan }, diffIndexLine = { fg = C.bright_black }, - DiffAdd = { bg = add_alpha(C.green, C.background, 0.20)}, -- diff mode: Added line |diff.txt| + DiffAdd = { bg = add_alpha(C.green, C.background, 0.20) }, -- diff mode: Added line |diff.txt| DiffChange = { bg = add_alpha(C.yellow, C.background, 0.20) }, -- diff mode: Changed line |diff.txt| DiffDelete = { bg = add_alpha(C.bright_red, C.background, 0.20) }, -- diff mode: Deleted line |diff.txt| DiffText = { bg = add_alpha(C.yellow, C.background, 0.35) }, -- diff mode: Changed text within a changed line |diff.txt| @@ -417,7 +417,7 @@ M.theme = function(C, O) CmpItemMenu = { fg = C.white }, CmpItemAbbrMatch = { fg = C.bright_green, bold = O.bold }, CmpItemAbbrMatchFuzzy = { fg = C.bright_green, bold = O.bold }, - CmpSel = { fg = C.black, bg = C.baby_blue, bold = O.bold }, -- Visual mode selection + CmpSel = { fg = C.black, bg = add_alpha(C.baby_blue, C.background, 0.9), bold = O.bold }, -- Visual mode selection -- kind colors CmpItemKindSnippet = { fg = C.bright_cyan },