From 826fe56f5cf30a823dc627b8a710174d04004cef Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 5 Jul 2022 04:28:14 +0800 Subject: fix(mark): mark without a view restores at topline #19224 For a local mark without a view, currently trying to restore its view will put the cursor at topline, which is not the correct behavior. Initialize `topline_offset` to `MAXLNUM` instead to fix this. --- test/functional/editor/jump_spec.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test/functional') diff --git a/test/functional/editor/jump_spec.lua b/test/functional/editor/jump_spec.lua index d3d3d7f79d..63f522fe6e 100644 --- a/test/functional/editor/jump_spec.lua +++ b/test/functional/editor/jump_spec.lua @@ -251,4 +251,32 @@ describe("jumpoptions=view", function() | ]]) end) + + it('falls back to standard behavior for a mark without a view', function() + local screen = Screen.new(5, 8) + screen:attach() + command('edit ' .. file1) + feed('10ggzzvwy') + screen:expect([[ + 7 line | + 8 line | + 9 line | + ^10 line | + 11 line | + 12 line | + 13 line | + | + ]]) + feed('`]') + screen:expect([[ + 7 line | + 8 line | + 9 line | + 10 ^line | + 11 line | + 12 line | + 13 line | + | + ]]) + end) end) -- cgit