mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 10:00:29 +00:00
fix: emergency fix
This commit is contained in:
parent
3e32576076
commit
527686e06d
@ -41,6 +41,7 @@ end
|
|||||||
--- @class HarpoonData
|
--- @class HarpoonData
|
||||||
--- @field _data HarpoonRawData
|
--- @field _data HarpoonRawData
|
||||||
--- @field has_error boolean
|
--- @field has_error boolean
|
||||||
|
--- @field config HarpoonConfig
|
||||||
local Data = {}
|
local Data = {}
|
||||||
|
|
||||||
-- 1. load the data
|
-- 1. load the data
|
||||||
@ -80,6 +81,7 @@ function Data:new(config)
|
|||||||
return setmetatable({
|
return setmetatable({
|
||||||
_data = data,
|
_data = data,
|
||||||
has_error = not ok,
|
has_error = not ok,
|
||||||
|
config = config,
|
||||||
}, self)
|
}, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -124,7 +126,7 @@ function Data:sync()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local ok, data = pcall(read_data)
|
local ok, data = pcall(read_data, self.config)
|
||||||
if not ok then
|
if not ok then
|
||||||
error("Harpoon: unable to sync data, error reading data file")
|
error("Harpoon: unable to sync data, error reading data file")
|
||||||
end
|
end
|
||||||
@ -133,7 +135,7 @@ function Data:sync()
|
|||||||
data[k] = v
|
data[k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
pcall(write_data, data)
|
pcall(write_data, data, self.config)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.Data = Data
|
M.Data = Data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user