less confusing code

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

View File

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