Made moving to a line beyond the end of a document move the caret column to the end of the line

This commit is contained in:
Joshua Barretto 2022-05-30 15:40:46 +01:00
parent 807d7a07fe
commit b3278f6360
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,9 @@ DocView.translate = {
end, end,
["next_page"] = function(doc, line, col, dv) ["next_page"] = function(doc, line, col, dv)
if line == #doc.lines then
return #doc.lines, #doc.lines[line]
end
local min, max = dv:get_visible_line_range() local min, max = dv:get_visible_line_range()
return line + (max - min), 1 return line + (max - min), 1
end, end,