Merge pull request #14864 from seandewar/get-config-zindex

fix(api/win_get_config): include z-index
This commit is contained in:
Björn Linse
2021-07-02 14:52:08 +02:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -456,6 +456,7 @@ Dictionary nvim_win_get_config(Window window, Error *err)
float_anchor_str[config->anchor]))); float_anchor_str[config->anchor])));
PUT(rv, "row", FLOAT_OBJ(config->row)); PUT(rv, "row", FLOAT_OBJ(config->row));
PUT(rv, "col", FLOAT_OBJ(config->col)); PUT(rv, "col", FLOAT_OBJ(config->col));
PUT(rv, "zindex", INTEGER_OBJ(config->zindex));
} }
if (config->border) { if (config->border) {
Array border = ARRAY_DICT_INIT; Array border = ARRAY_DICT_INIT;

View File

@@ -398,8 +398,8 @@ describe('float window', function()
it('return their configuration', function() it('return their configuration', function()
local buf = meths.create_buf(false, false) local buf = meths.create_buf(false, false)
local win = meths.open_win(buf, false, {relative='editor', width=20, height=2, row=3, col=5}) local win = meths.open_win(buf, false, {relative='editor', width=20, height=2, row=3, col=5, zindex=60})
local expected = {anchor='NW', col=5, external=false, focusable=true, height=2, relative='editor', row=3, width=20} local expected = {anchor='NW', col=5, external=false, focusable=true, height=2, relative='editor', row=3, width=20, zindex=60}
eq(expected, meths.win_get_config(win)) eq(expected, meths.win_get_config(win))
eq({relative='', external=false, focusable=true}, meths.win_get_config(0)) eq({relative='', external=false, focusable=true}, meths.win_get_config(0))
@@ -1674,7 +1674,7 @@ describe('float window', function()
]]} ]]}
end end
eq({relative='win', width=12, height=1, bufpos={1,32}, anchor='NW', eq({relative='win', width=12, height=1, bufpos={1,32}, anchor='NW',
external=false, col=0, row=1, win=firstwin, focusable=true}, meths.win_get_config(win)) external=false, col=0, row=1, win=firstwin, focusable=true, zindex=50}, meths.win_get_config(win))
feed('<c-e>') feed('<c-e>')
if multigrid then if multigrid then