Fix keeping scroll position when restoring a `DocView` (#910)

Since 5526041da3 we check a pair of 
line&column to decide if we should scroll to the cursor.
Previously we only considered a single line&column.
This commit is contained in:
Guldoman 2022-04-03 22:24:39 +02:00 committed by GitHub
parent 23bd21a191
commit 50acf2e7e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -117,7 +117,7 @@ local function load_view(t)
-- cannot be read.
if dv and dv.doc then
dv.doc:set_selection(table.unpack(t.selection))
dv.last_line, dv.last_col = dv.doc:get_selection()
dv.last_line1, dv.last_col1, dv.last_line2, dv.last_col2 = dv.doc:get_selection()
dv.scroll.x, dv.scroll.to.x = t.scroll.x, t.scroll.x
dv.scroll.y, dv.scroll.to.y = t.scroll.y, t.scroll.y
end