mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-16 11:00:23 +00:00
If out_data is empty then write empty json to harpoon.json. Then read it back into out_data.
This commit is contained in:
parent
d8fa264598
commit
05edc3ee82
@ -58,6 +58,12 @@ local function read_data()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local out_data = path:read()
|
local out_data = path:read()
|
||||||
|
|
||||||
|
if not out_data or out_data == '' then
|
||||||
|
write_data({})
|
||||||
|
out_data = path:read()
|
||||||
|
end
|
||||||
|
|
||||||
local data = vim.json.decode(out_data)
|
local data = vim.json.decode(out_data)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user