diff options
author | fredizzimo <fsundvik@gmail.com> | 2025-02-09 22:31:14 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-09 07:31:14 -0800 |
commit | af0cd9a9075117319808b8c0515cd86628992baf (patch) | |
tree | 0437eff3e74e2f5cf77cda59fbc3e516433f4621 /test/functional/ui/multigrid_spec.lua | |
parent | 9198368f32dc0b4e2470b594f323691d45501442 (diff) | |
download | rneovim-af0cd9a9075117319808b8c0515cd86628992baf.tar.gz rneovim-af0cd9a9075117319808b8c0515cd86628992baf.tar.bz2 rneovim-af0cd9a9075117319808b8c0515cd86628992baf.zip |
test: screen.lua can check win_pos #32373
Also remove a hack in the multigrid "with winbar" test.
Diffstat (limited to 'test/functional/ui/multigrid_spec.lua')
-rw-r--r-- | test/functional/ui/multigrid_spec.lua | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua index cac7174cb6..9cd252264f 100644 --- a/test/functional/ui/multigrid_spec.lua +++ b/test/functional/ui/multigrid_spec.lua @@ -2407,6 +2407,22 @@ describe('ext_multigrid', function() it('with winbar', function() command('split') + local win_pos ={ + [2] = { + height = 5, + startcol = 0, + startrow = 7, + width = 53, + win = 1000 + }, + [4] = { + height = 6, + startcol = 0, + startrow = 0, + width = 53, + win = 1001 + } + } screen:expect{grid=[[ ## grid 1 [4:-----------------------------------------------------]|*6 @@ -2428,15 +2444,7 @@ describe('ext_multigrid', function() }, 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. - local orig_handle_win_pos = screen._handle_win_pos - local win_pos = {} - function screen._handle_win_pos(self, grid, win, startrow, startcol, width, height) - table.insert(win_pos, {grid, win, startrow, startcol, width, height}) - orig_handle_win_pos(self, grid, win, startrow, startcol, width, height) - end + }, win_pos = win_pos } command('setlocal winbar=very%=bar') screen:expect{grid=[[ @@ -2461,8 +2469,7 @@ describe('ext_multigrid', function() }, 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) + }, win_pos = win_pos } command('setlocal winbar=') screen:expect{grid=[[ @@ -2486,8 +2493,7 @@ describe('ext_multigrid', function() }, 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) + }, win_pos = win_pos } end) it('with winbar dragging statusline with mouse works correctly', function() |