From 2e4e12756a697d4767ec294e1f268384395e7a7f Mon Sep 17 00:00:00 2001 From: bfredl Date: Thu, 28 Mar 2024 15:27:32 +0100 Subject: feat(ui): indicate margins for the area used by win_viewport Problem: using win_viewport for implementing smooth scrolling in an external UI might run into problems when winbar or borders is used, as there is no indication that the entire grid is not used for scrolled buffer text. Solution: add `win_viewport_margins` event. --- test/functional/ui/multigrid_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/functional/ui/multigrid_spec.lua') diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua index 4b11a881ed..bb490546f6 100644 --- a/test/functional/ui/multigrid_spec.lua +++ b/test/functional/ui/multigrid_spec.lua @@ -2354,6 +2354,9 @@ describe('ext_multigrid', function() ]], win_viewport={ [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + }, win_viewport_margins={ + [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0}; + [4] = {win = 1001, top = 0, bottom = 0, left = 0, right = 0}; }} -- XXX: hack to get notifications. Could use next_msg() also. @@ -2384,6 +2387,9 @@ describe('ext_multigrid', function() ]], win_viewport={ [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + }, win_viewport_margins={ + [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0}; + [4] = {win = 1001, top = 1, bottom = 0, left = 0, right = 0}; }} eq({}, win_pos) @@ -2406,6 +2412,9 @@ describe('ext_multigrid', function() ]], win_viewport={ [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + }, win_viewport_margins={ + [2] = {win = 1000, top = 0, bottom = 0, left = 0, right = 0}; + [4] = {win = 1001, top = 0, bottom = 0, left = 0, right = 0}; }} eq({}, win_pos) end) -- cgit