Truncate helper, txtlen is local.
This commit is contained in:
parent
3b3e0dc7cf
commit
41d4acb7a2
|
@ -43,7 +43,7 @@ end
|
||||||
|
|
||||||
--{{{ Truncate a string
|
--{{{ Truncate a string
|
||||||
function truncate(text, maxlen)
|
function truncate(text, maxlen)
|
||||||
txtlen = text:len()
|
local txtlen = text:len()
|
||||||
|
|
||||||
if txtlen > maxlen then
|
if txtlen > maxlen then
|
||||||
text = text:sub(1, maxlen - 3) .. "..."
|
text = text:sub(1, maxlen - 3) .. "..."
|
||||||
|
|
Loading…
Reference in New Issue