From b9482a0a26f4feffd0a7603389fd7270bd43b8ad Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 8 Oct 2025 07:10:59 +0800 Subject: [PATCH] test: add a test for #36059 --- test/functional/ui/highlight_spec.lua | 61 +++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index d6c47d9f1f..af9add727a 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -443,6 +443,67 @@ describe('highlight', function() ]]) end) + it("is updated with H/L and 'scrolloff' #36059", function() + local screen = Screen.new(40, 10) + exec([[ + call setline(1, map(range(1, 100), "'line ' .. v:val")) + set scrolloff=2 nostartofline + call cursor(50, 1) + ]]) + feed('zV') + screen:expect([[ + line 48 | + line 49 | + ^l{17:ine 50} | + line 51 | + line 52 | + line 53 | + line 54 | + line 55 | + line 56 | + {5:-- VISUAL LINE --} | + ]]) + feed('L') + screen:expect([[ + line 48 | + line 49 | + {17:line 50} | + {17:line 51} | + {17:line 52} | + {17:line 53} | + ^l{17:ine 54} | + line 55 | + line 56 | + {5:-- VISUAL LINE --} | + ]]) + feed('V') + screen:expect([[ + line 48 | + line 49 | + line 50 | + line 51 | + line 52 | + line 53 | + ^l{17:ine 54} | + line 55 | + line 56 | + {5:-- VISUAL LINE --} | + ]]) + feed('H') + screen:expect([[ + line 48 | + line 49 | + ^l{17:ine 50} | + {17:line 51} | + {17:line 52} | + {17:line 53} | + {17:line 54} | + line 55 | + line 56 | + {5:-- VISUAL LINE --} | + ]]) + end) + it('cterm=standout gui=standout', function() local screen = Screen.new(20, 5) screen:add_extra_attr_ids {