better readable condition

Co-authored-by: Christopher Head <chead@chead.ca>
This commit is contained in:
Peter Nerlich 2020-12-07 14:17:39 +01:00 committed by GitHub
parent c5aeb9e8c5
commit d3fecd94e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ local create_lines = function(text)
line = line .. " "
remaining = remaining - 1
end
if remaining - string.len(word) < 0 then
if remaining < string.len(word) then
line = line .. string.sub(word, 1, math.min(remaining, string.len(word)))
word = string.sub(word, remaining+1, string.len(word))
if flush_line_and_check_for_return() then return tab end