commit 4d1d3cb14dbe3deba568c49739ea948911d56299
parent e3fd305a9a698eeaf77f1966b7b7f55f6d0f632a
Author: Nihal Jere <nihal@nihaljere.xyz>
Date: Tue, 23 Aug 2022 11:10:03 -0500
pull whitespace killing out
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/smallpond.lua b/smallpond.lua
@@ -41,6 +41,7 @@ commands = {
function parse(text)
local i = 1
return function()
+ i = i + #(string.match(text, "^%s*", i) or "")
if i >= #text then return nil end
local cmd = string.match(text, "^\\(%a+)", i)
if cmd then
@@ -49,7 +50,7 @@ function parse(text)
return data
end
- local s, e, note = string.find(text, "^%s*([abcdefg])", i)
+ local s, e, note = string.find(text, "^([abcdefg])", i)
if note then
i = i + e - s + 1
return {command="newnote", note=note}