Fix lines "global"
This commit is contained in:
parent
b91148e7da
commit
17b5faa520
8
init.lua
8
init.lua
@ -45,9 +45,9 @@ local function unpack(text,width, settings)
|
|||||||
text = text:gsub("\r", "\n") -- MacOs 9 and older
|
text = text:gsub("\r", "\n") -- MacOs 9 and older
|
||||||
|
|
||||||
-- 2. Break apart lines into array
|
-- 2. Break apart lines into array
|
||||||
lines = {}
|
local _lines = {}
|
||||||
for s in text:gmatch("([^\n]*)\n?") do
|
for s in text:gmatch("([^\n]*)\n?") do
|
||||||
table.insert(lines, s)
|
table.insert(_lines, s)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 3. Handle Settings
|
-- 3. Handle Settings
|
||||||
@ -80,8 +80,8 @@ local function unpack(text,width, settings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- 5. iterate over lines, parsing linearly
|
-- 5. iterate over lines, parsing linearly
|
||||||
for lineNumber=1, #lines, 1 do
|
for lineNumber=1, #_lines, 1 do
|
||||||
parseLine(lines[lineNumber], state) --state is changed within function
|
parseLine(_lines[lineNumber], state) --state is changed within function
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 6. return the parsed formspec
|
-- 6. return the parsed formspec
|
||||||
|
Loading…
x
Reference in New Issue
Block a user