Skip to content

Commit

Permalink
properly create new scratchpad on first use
Browse files Browse the repository at this point in the history
Refs #7
  • Loading branch information
rkusa committed Nov 16, 2019
1 parent 059263e commit c20af30
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Scripts/Hooks/scratchpad-hook.lua
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,20 @@ function scratchpad_load()
end
end
end

-- there are no pages yet, create one
if pagesCount == 0 then
path = dirPath .. [[0000.txt]]
scratchpad.log("creating page " .. path)
table.insert(
pages,
{
name = "0000",
path = path
}
)
pagesCount = pagesCount + 1
end
end

function scratchpad.saveConfiguration()
Expand Down

0 comments on commit c20af30

Please sign in to comment.