DKL9 GitList
Repositories
DKL9 home
memoire
Code
Commits
Branches
Tags
Search
Tree:
b39812d
Branches
Tags
master
memoire
src
correction.lua
Reformulate data structures
John Smith
commited
b39812d
at 2023-177 12:35:37
correction.lua
Blame
History
Raw
local function fn(config, deck, _, ip) local sc = deck[ip[1]] local ot = sc.note local fname = "memoire_cc.tmp" local fh = io.open(fname, "w") fh:write(ot) fh:close() os.execute(string.format( "%s %q", os.getenv("EDITOR") or "vi", fname )) fh = io.open(fname, "r") local nt = fh:read("a"):gsub("%s+$", ""):gsub("^%s+", "") fh:close() os.remove(fname) if nt ~= ot and nt ~= "" then deck[ip[1]].note = nt return deck end end return { desc = "(c)orrect card (with card:prompt index)", nd = true, ni = true, fn = fn }