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-28 18:41:59 +02:00 committed by Francesco
parent 3e6afeccc0
commit f106993d0e
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ function Doc:load(filename)
self.crlf = true
end
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
max_length = line_len
line_numbers = { [i] = true } -- new longest line