Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 55d1564

Browse files
committed
fix(performance): boost
1 parent f0f533f commit 55d1564

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lua/leetcode/init.lua renamed to lua/leetcode.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local config = require("leetcode.config")
22

3-
---@class lc
3+
---@class lc.LeetCode
44
local leetcode = {}
55

66
local function should_start()
@@ -52,6 +52,10 @@ local function setup_cmds()
5252
end
5353

5454
local function start()
55+
local path = require("plenary.path")
56+
config.home = path:new(config.user.directory) ---@diagnostic disable-line
57+
config.home:mkdir()
58+
5559
setup_highlights()
5660
setup_cmds()
5761

lua/leetcode/config/init.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ local config = {
99
domain = "https://leetcode.com",
1010
debug = false,
1111
lang = "cpp",
12+
home = {}, ---@type Path
1213
}
1314

1415
---@class lc.UserAuth
@@ -22,16 +23,11 @@ config.auth = {}
2223
---
2324
---@param cfg lc.UserConfig Configurations to be merged.
2425
function config.apply(cfg)
25-
local path = require("plenary.path")
26-
2726
config.user = vim.tbl_deep_extend("force", config.default, cfg)
2827

29-
config.debug = config.user.debug or false
28+
config.debug = config.user.debug or false ---@diagnostic disable-line
3029
config.domain = "https://leetcode." .. config.user.domain
3130
config.lang = config.user.lang
32-
---@type Path
33-
config.home = path:new(config.user.directory)
34-
config.home:mkdir()
3531
end
3632

3733
return config

0 commit comments

Comments
 (0)