mirror of
https://github.com/minetest-mods/digilines.git
synced 2025-07-01 07:50:22 +02:00
if a words fits the screen width exactly, don't put it on the next line
This commit is contained in:
2
lcd.lua
2
lcd.lua
@ -35,7 +35,7 @@ local create_lines = function(text)
|
||||
local line_num = 1
|
||||
local tab = {}
|
||||
for word in string.gmatch(text, "%S*") do
|
||||
if string.len(line)+string.len(word) < LINE_LENGTH and word ~= "|" then
|
||||
if (string.len(line) and string.len(line)+1) + string.len(word) <= LINE_LENGTH and word ~= "|" then
|
||||
if line ~= "" then
|
||||
line = line.." "..word
|
||||
else
|
||||
|
Reference in New Issue
Block a user