Fix final line of text widget being lost
This commit is contained in:
parent
a8bc9b83ad
commit
54c43e07cc
10
init.lua
10
init.lua
@ -362,10 +362,12 @@ end
|
|||||||
-- Inserts automatic line breaks into an entire text and preserves existing newlines
|
-- Inserts automatic line breaks into an entire text and preserves existing newlines
|
||||||
local linebreaker = function(text, linelength)
|
local linebreaker = function(text, linelength)
|
||||||
local out = ""
|
local out = ""
|
||||||
for s in string.gmatch(text, "([^\n]*)\n") do
|
for s in string.gmatch(text, "([^\n]*)") do
|
||||||
s = linebreaker_single(s, linelength)
|
local l = linebreaker_single(s, linelength)
|
||||||
out = out .. s
|
out = out .. l
|
||||||
out = out .. "\n"
|
if(string.len(l) == 0) then
|
||||||
|
out = out .. "\n"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- Remove last newline
|
-- Remove last newline
|
||||||
if string.len(out) >= 1 then
|
if string.len(out) >= 1 then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user