mirror of
https://github.com/minetest-mods/digilines.git
synced 2024-09-27 22:30:22 +02:00
split line on |
even when it fits on screen
This commit is contained in:
parent
cb4135a7a7
commit
f5ff984427
4
lcd.lua
4
lcd.lua
|
@ -35,7 +35,9 @@ local create_lines = function(text)
|
||||||
local line_num = 1
|
local line_num = 1
|
||||||
local tab = {}
|
local tab = {}
|
||||||
if #text <= LINE_LENGTH then
|
if #text <= LINE_LENGTH then
|
||||||
line = text
|
for line in string.gmatch(text, " | ") do
|
||||||
|
table.insert(tab, line)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user