In lua you can't delete tables, so is there a way to generate a unique one-shot variable name for the table? This code works, it just concenates the next map onto the previous map, which isn't what is supposed to happen. I suppose I could modify the code to write directly to the miniwindow, which is what its going to do, but I want to actually have the table to be able to manipulate it, and I feel it makes to understand if you split up the data entry, and the formatting.
AddTriggerEx ("map_begin",
"^-* (v\d*) -*$",
"table.insert\(map_buffer,\"%1\"\) EnableTrigger\(\"line_capture\", true\)",
49,
custom_colour.Custom15,
0,
"",
"",
12,
99)
AddTriggerEx ("map_terminate",
"(^--- .* -.*$)",
"table.insert\(map_buffer,\"%1\"\) EnableTrigger\(\"line_capture\", false\) write_map\(map_buffer\)",
49,
custom_colour.Custom15,
0,
"",
"",
12,
99)
AddTriggerEx ("line_capture",
"(^.*$)",
"table.insert\(map_buffer,\"%1\"\)",
49,
custom_colour.Custom15,
0,
"",
"",
12,
100)
function write_map (x)
for i,v in ipairs(x) do
print (v)
end
end
|