Skip to content

Commit

Permalink
Merge pull request #378 from mwishoff/harpoon2
Browse files Browse the repository at this point in the history
If out_data is empty then write empty json to harpoon.json. Then read…
  • Loading branch information
ThePrimeagen authored Dec 6, 2023
2 parents d8fa264 + 05edc3e commit b66e92d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/harpoon/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ local function read_data()
end

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)
return data
end
Expand Down

0 comments on commit b66e92d

Please sign in to comment.