fix(style): add parentheses (#471)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
local api = vim.api
|
||||
|
||||
local Config = require "avante.config"
|
||||
local bit = require "bit"
|
||||
local Config = require("avante.config")
|
||||
local bit = require("bit")
|
||||
local rshift, band = bit.rshift, bit.band
|
||||
|
||||
local Highlights = {
|
||||
@@ -29,8 +29,8 @@ local H = {}
|
||||
|
||||
local M = {}
|
||||
|
||||
M.input_ns = api.nvim_create_namespace "avante_input"
|
||||
M.hint_ns = api.nvim_create_namespace "avante_hint"
|
||||
M.input_ns = api.nvim_create_namespace("avante_input")
|
||||
M.hint_ns = api.nvim_create_namespace("avante_hint")
|
||||
|
||||
local function has_set_colors(hl_group)
|
||||
local hl = api.nvim_get_hl(0, { name = hl_group })
|
||||
@@ -46,7 +46,7 @@ M.setup = function()
|
||||
.iter(Highlights)
|
||||
:filter(function(k, _)
|
||||
-- return all uppercase key with underscore or fully uppercase key
|
||||
return k:match "^%u+_" or k:match "^%u+$"
|
||||
return k:match("^%u+_") or k:match("^%u+$")
|
||||
end)
|
||||
:each(function(_, hl)
|
||||
if not has_set_colors(hl.name) then
|
||||
@@ -113,7 +113,7 @@ setmetatable(M, {
|
||||
---@param rgb_24bit number 24-bit RGB value
|
||||
---@return {r: integer, g: integer, b: integer} with keys 'r', 'g', 'b' in [0,255]
|
||||
H.decode_24bit_rgb = function(rgb_24bit)
|
||||
vim.validate { rgb_24bit = { rgb_24bit, "n", true } }
|
||||
vim.validate({ rgb_24bit = { rgb_24bit, "n", true } })
|
||||
local r = band(rshift(rgb_24bit, 16), 255)
|
||||
local g = band(rshift(rgb_24bit, 8), 255)
|
||||
local b = band(rgb_24bit, 255)
|
||||
|
||||
Reference in New Issue
Block a user