Fix discrepancy in max line length

The line length calculated in `Doc:load` didn't account for the newline 
that gets added.
This commit is contained in:
Guldoman
2021-08-30 17:58:22 +02:00
committed by Francesco
parent 3e6afeccc0
commit f106993d0e
+1 -1
View File
@@ -72,7 +72,7 @@ function Doc:load(filename)
self.crlf = true self.crlf = true
end end
table.insert(self.lines, line .. "\n") table.insert(self.lines, line .. "\n")
local line_len = string.len(line) local line_len = string.len(line) + 1 -- account for newline
if line_len > max_length then if line_len > max_length then
max_length = line_len max_length = line_len
line_numbers = { [i] = true } -- new longest line line_numbers = { [i] = true } -- new longest line