From b3278f6360a2342883fa641ccfcc67159923bac9 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 30 May 2022 15:40:46 +0100 Subject: [PATCH] Made moving to a line beyond the end of a document move the caret column to the end of the line --- data/core/docview.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/core/docview.lua b/data/core/docview.lua index 2c624d80..f5440262 100644 --- a/data/core/docview.lua +++ b/data/core/docview.lua @@ -29,6 +29,9 @@ DocView.translate = { end, ["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() return line + (max - min), 1 end,