aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/ui/multigrid_spec.lua32
-rw-r--r--test/functional/ui/screen.lua7
2 files changed, 26 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()
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 6a8e7df6a0..9ff29cd706 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -338,6 +338,7 @@ local ext_keys = {
'showmode',
'showcmd',
'ruler',
+ 'win_pos',
'float_pos',
'win_viewport',
'win_viewport_margins',
@@ -357,6 +358,7 @@ local expect_keys = {
request_cb = true,
hl_groups = true,
extmarks = true,
+ win_pos = true,
}
for _, v in ipairs(ext_keys) do
@@ -426,6 +428,7 @@ end
--- @field mouse_enabled? boolean
---
--- @field win_viewport? table<integer,table<string,integer>>
+--- @field win_pos? table<integer,table<string,integer>>
--- @field float_pos? [integer,integer]
--- @field hl_groups? table<string,integer>
---
@@ -628,6 +631,9 @@ screen:redraw_debug() to show all intermediate screen states.]]
if expected.win_viewport_margins == nil then
extstate.win_viewport_margins = nil
end
+ if expected.win_pos == nil then
+ extstate.win_pos = nil
+ end
if expected.float_pos then
expected.float_pos = deepcopy(expected.float_pos)
@@ -1520,6 +1526,7 @@ function Screen:_extstate_repr(attr_state)
float_pos = self.float_pos,
win_viewport = win_viewport,
win_viewport_margins = win_viewport_margins,
+ win_pos = self.win_position,
}
end