aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2024-03-01 14:51:49 +0100
committerLuuk van Baal <luukvbaal@gmail.com>2024-03-01 16:00:16 +0100
commit884470124db3848283dc3ae7c43b4b119d4162f9 (patch)
tree4dbfe49cbea78c191a41e187de71476e2ae3d0cd /src
parent5d4e1693cb415e8b76749e833e28f00f14630b87 (diff)
downloadrneovim-884470124db3848283dc3ae7c43b4b119d4162f9.tar.gz
rneovim-884470124db3848283dc3ae7c43b4b119d4162f9.tar.bz2
rneovim-884470124db3848283dc3ae7c43b4b119d4162f9.zip
fix(float): allow floating window in cmdline area
Problem: Floats are arbitrarily positioned at 1 row above screen size. Solution: Position at 1 row above 'cmdheight', only if window is hidden behind the message area.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/window.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index b631cbe7c8..e2c4524eaa 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -817,9 +817,10 @@ void ui_ext_win_position(win_T *wp, bool validate)
int comp_row = (int)row - (south ? wp->w_height_outer : 0);
int comp_col = (int)col - (east ? wp->w_width_outer : 0);
+ int above_ch = wp->w_config.zindex < kZIndexMessages ? (int)p_ch : 0;
comp_row += grid->comp_row;
comp_col += grid->comp_col;
- comp_row = MAX(MIN(comp_row, Rows - wp->w_height_outer - (p_ch > 0 ? 1 : 0)), 0);
+ comp_row = MAX(MIN(comp_row, Rows - wp->w_height_outer - above_ch), 0);
if (!c.fixed || east) {
comp_col = MAX(MIN(comp_col, Columns - wp->w_width_outer), 0);
}