Skip to content

Commit 9088ade

Browse files
chore: rename utils files
1 parent 919ffc2 commit 9088ade

File tree

6 files changed

+38
-48
lines changed

6 files changed

+38
-48
lines changed

colors/custom.lua

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
-- A slightly altered version of catppucchin mocha
2+
-- stylua: ignore
23
local mocha = {
34
rosewater = '#f5e0dc',
4-
flamingo = '#f2cdcd',
5-
pink = '#f5c2e7',
6-
mauve = '#cba6f7',
7-
red = '#f38ba8',
8-
maroon = '#eba0ac',
9-
peach = '#fab387',
10-
yellow = '#f9e2af',
11-
green = '#a6e3a1',
12-
teal = '#94e2d5',
13-
sky = '#89dceb',
14-
sapphire = '#74c7ec',
15-
blue = '#89b4fa',
16-
lavender = '#b4befe',
17-
text = '#cdd6f4',
18-
subtext1 = '#bac2de',
19-
subtext0 = '#a6adc8',
20-
overlay2 = '#9399b2',
21-
overlay1 = '#7f849c',
22-
overlay0 = '#6c7086',
23-
surface2 = '#585b70',
24-
surface1 = '#45475a',
25-
surface0 = '#313244',
26-
base = '#1f1f28',
27-
mantle = '#181825',
28-
crust = '#11111b',
5+
flamingo = '#f2cdcd',
6+
pink = '#f5c2e7',
7+
mauve = '#cba6f7',
8+
red = '#f38ba8',
9+
maroon = '#eba0ac',
10+
peach = '#fab387',
11+
yellow = '#f9e2af',
12+
green = '#a6e3a1',
13+
teal = '#94e2d5',
14+
sky = '#89dceb',
15+
sapphire = '#74c7ec',
16+
blue = '#89b4fa',
17+
lavender = '#b4befe',
18+
text = '#cdd6f4',
19+
subtext1 = '#bac2de',
20+
subtext0 = '#a6adc8',
21+
overlay2 = '#9399b2',
22+
overlay1 = '#7f849c',
23+
overlay0 = '#6c7086',
24+
surface2 = '#585b70',
25+
surface1 = '#45475a',
26+
surface0 = '#313244',
27+
base = '#1f1f28',
28+
mantle = '#181825',
29+
crust = '#11111b',
2930
}
3031

3132
local colorscheme = {

config/appearance.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local gpu_adapters = require('utils.gpu_adapter')
1+
local gpu_adapters = require('utils.gpu-adapter')
22
local backdrops = require('utils.backdrops')
33
local colors = require('colors.custom')
44

events/right-status.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
local wezterm = require('wezterm')
22
local umath = require('utils.math')
33
local Cells = require('utils.cells')
4-
local EventOpts = require('utils.event_opts')
4+
local OptsValidator = require('utils.opts-validator')
55

66
---@alias Event.RightStatusOptions { date_format?: string }
77

@@ -16,7 +16,7 @@ EVENT_OPTS.schema = {
1616
default = '%a %H:%M:%S',
1717
},
1818
}
19-
EVENT_OPTS.validator = EventOpts:new(EVENT_OPTS.schema)
19+
EVENT_OPTS.validator = OptsValidator:new(EVENT_OPTS.schema)
2020

2121
local nf = wezterm.nerdfonts
2222
local attr = Cells.attr

events/tab-title.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
local wezterm = require('wezterm')
66
local Cells = require('utils.cells')
7-
local EventOpts = require('utils.event_opts')
7+
local OptsValidator = require('utils.opts-validator')
88

99
---
1010
-- =======================================
@@ -30,7 +30,7 @@ EVENT_OPTS.schema = {
3030
default = true,
3131
},
3232
}
33-
EVENT_OPTS.validator = EventOpts:new(EVENT_OPTS.schema)
33+
EVENT_OPTS.validator = OptsValidator:new(EVENT_OPTS.schema)
3434

3535
---
3636
-- ===================
File renamed without changes.

utils/event_opts.lua renamed to utils/opts-validator.lua

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,38 +83,27 @@ local function validate_opts_schema(schema)
8383
end
8484

8585
---Event options validation class
86-
---@class EventOpts
86+
---@class OptsValidator
8787
---@field schema OptsSchema
88-
local EventOpts = {}
89-
EventOpts.__index = EventOpts
88+
local OptsValidator = {}
89+
OptsValidator.__index = OptsValidator
9090

91-
---Create a new instance of EventOpts
91+
---Create a new instance of OptsValidator
9292
---@param schema OptsSchema
93-
function EventOpts:new(schema)
93+
function OptsValidator:new(schema)
9494
validate_opts_schema(schema)
9595
local event_opts = { schema = schema }
9696
return setmetatable(event_opts, self)
9797
end
9898

99-
---Get the default values for the event options based on the schema
100-
---@generic T
101-
---@return T
102-
function EventOpts:get_defaults()
103-
local defaults = {}
104-
for _, opt in ipairs(self.schema) do
105-
defaults[opt.name] = opt.default
106-
end
107-
return defaults
108-
end
109-
11099
---Validate the event options against the schema
111100
---If the options are valid, it returns the options and nil
112101
---If a field is invalid, it returns the default value and an error message
113102
---@generic T
114103
---@param opts T
115104
---@return T
116105
---@return string|nil
117-
function EventOpts:validate(opts)
106+
function OptsValidator:validate(opts)
118107
local errors = {}
119108
local valid_opts = {}
120109

@@ -185,4 +174,4 @@ function EventOpts:validate(opts)
185174
return valid_opts, nil
186175
end
187176

188-
return EventOpts
177+
return OptsValidator

0 commit comments

Comments
 (0)