mirror of
https://github.com/minetest-mods/digilines.git
synced 2024-09-26 05:40:26 +02:00
don't swallow multiple spaces
(only at line breaks)
This commit is contained in:
parent
8c1ba6714e
commit
3c0900c115
6
lcd.lua
6
lcd.lua
|
@ -34,7 +34,7 @@ local create_lines = function(text)
|
||||||
local line = ""
|
local line = ""
|
||||||
local line_num = 1
|
local line_num = 1
|
||||||
local tab = {}
|
local tab = {}
|
||||||
for word in string.gmatch(text, "%S+") do
|
for word in string.gmatch(text, "%S*") do
|
||||||
if string.len(line)+string.len(word) < LINE_LENGTH and word ~= "|" then
|
if string.len(line)+string.len(word) < LINE_LENGTH and word ~= "|" then
|
||||||
if line ~= "" then
|
if line ~= "" then
|
||||||
line = line.." "..word
|
line = line.." "..word
|
||||||
|
@ -43,7 +43,9 @@ local create_lines = function(text)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
table.insert(tab, line)
|
table.insert(tab, line)
|
||||||
if word ~= "|" then
|
if word == " " then
|
||||||
|
-- don't at the space since we have a line break
|
||||||
|
elseif word ~= "|" then
|
||||||
line = word
|
line = word
|
||||||
else
|
else
|
||||||
line = ""
|
line = ""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user