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 }