mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 10:18:18 +00:00
fix(float): fix float window with winbar cannot have screen height
This commit is contained in:
@@ -783,8 +783,8 @@ void win_config_float(win_T *wp, FloatConfig fconfig)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ui_has(kUIMultigrid)) {
|
if (!ui_has(kUIMultigrid)) {
|
||||||
wp->w_height = MIN(wp->w_height, Rows - 1 - win_extra_height(wp));
|
wp->w_height = MIN(wp->w_height, Rows - 1 - win_border_height(wp));
|
||||||
wp->w_width = MIN(wp->w_width, Columns - win_extra_width(wp));
|
wp->w_width = MIN(wp->w_width, Columns - win_border_width(wp));
|
||||||
}
|
}
|
||||||
|
|
||||||
win_set_inner_size(wp);
|
win_set_inner_size(wp);
|
||||||
@@ -6330,18 +6330,18 @@ void win_set_inner_size(win_T *wp)
|
|||||||
terminal_check_size(wp->w_buffer->terminal);
|
terminal_check_size(wp->w_buffer->terminal);
|
||||||
}
|
}
|
||||||
|
|
||||||
wp->w_height_outer = (wp->w_height_inner + win_extra_height(wp));
|
wp->w_height_outer = (wp->w_height_inner + win_border_height(wp) + wp->w_winbar_height);
|
||||||
wp->w_width_outer = (wp->w_width_inner + win_extra_width(wp));
|
wp->w_width_outer = (wp->w_width_inner + win_border_width(wp));
|
||||||
wp->w_winrow_off = wp->w_border_adj[0] + wp->w_winbar_height;
|
wp->w_winrow_off = wp->w_border_adj[0] + wp->w_winbar_height;
|
||||||
wp->w_wincol_off = wp->w_border_adj[3];
|
wp->w_wincol_off = wp->w_border_adj[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
static int win_extra_height(win_T *wp)
|
static int win_border_height(win_T *wp)
|
||||||
{
|
{
|
||||||
return wp->w_border_adj[0] + wp->w_border_adj[2] + wp->w_winbar_height;
|
return wp->w_border_adj[0] + wp->w_border_adj[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
static int win_extra_width(win_T *wp)
|
static int win_border_width(win_T *wp)
|
||||||
{
|
{
|
||||||
return wp->w_border_adj[1] + wp->w_border_adj[3];
|
return wp->w_border_adj[1] + wp->w_border_adj[3];
|
||||||
}
|
}
|
||||||
|
@@ -7896,8 +7896,8 @@ describe('float window', function()
|
|||||||
]]}
|
]]}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- add a border
|
-- resize and add a border
|
||||||
meths.win_set_config(win1, {relative='editor', width=15, height=3, row=0, col=4, border = 'single'})
|
meths.win_set_config(win1, {relative='editor', width=15, height=4, row=0, col=4, border = 'single'})
|
||||||
|
|
||||||
if multigrid then
|
if multigrid then
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
@@ -7923,6 +7923,7 @@ describe('float window', function()
|
|||||||
{5:│}{3:floaty bar }{5:│}|
|
{5:│}{3:floaty bar }{5:│}|
|
||||||
{5:│}{1: }{5:│}|
|
{5:│}{1: }{5:│}|
|
||||||
{5:│}{2:~ }{5:│}|
|
{5:│}{2:~ }{5:│}|
|
||||||
|
{5:│}{2:~ }{5:│}|
|
||||||
{5:└───────────────┘}|
|
{5:└───────────────┘}|
|
||||||
]], float_pos={
|
]], float_pos={
|
||||||
[4] = {{id = 1001}, "NW", 1, 0, 4, true, 50};
|
[4] = {{id = 1001}, "NW", 1, 0, 4, true, 50};
|
||||||
@@ -7936,8 +7937,8 @@ describe('float window', function()
|
|||||||
{0:~ }{5:│}{3:floaty bar }{5:│}{0: }|
|
{0:~ }{5:│}{3:floaty bar }{5:│}{0: }|
|
||||||
{0:~ }{5:│}{1: }{5:│}{0: }|
|
{0:~ }{5:│}{1: }{5:│}{0: }|
|
||||||
{0:~ }{5:│}{2:~ }{5:│}{0: }|
|
{0:~ }{5:│}{2:~ }{5:│}{0: }|
|
||||||
|
{0:~ }{5:│}{2:~ }{5:│}{0: }|
|
||||||
{0:~ }{5:└───────────────┘}{0: }|
|
{0:~ }{5:└───────────────┘}{0: }|
|
||||||
{0:~ }|
|
|
||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user