clix.adhoc: Improve handling of list items

Mon, 21 Mar 2016 16:12:25 +0100

author
Kim Alvefur <zash@zash.se>
date
Mon, 21 Mar 2016 16:12:25 +0100
changeset 125
75902417ff05
parent 124
ff422623e0ba
child 126
c9d03a70a936

clix.adhoc: Improve handling of list items

clix/adhoc.lua file | annotate | diff | comparison | revisions
--- a/clix/adhoc.lua	Mon Mar 21 16:11:54 2016 +0100
+++ b/clix/adhoc.lua	Mon Mar 21 16:12:25 2016 +0100
@@ -34,7 +34,11 @@
 										repeat
 										local line = io.read("*l");
 										if line and line ~= "" then
-											t[#t+1] = line;
+											if item.type:match"list%-" then
+												t[#t+1] = { label = line, value = line, default = true };
+											else
+												t[#t+1] = line;
+											end
 										end
 									until not line or line == "";
 									if item.type == "text-multi" then

mercurial