aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-13 23:08:01 +0800
committerGitHub <noreply@github.com>2023-05-13 23:08:01 +0800
commit79d5f06f79ca2f84a89be3fe2b3d498a72e37a55 (patch)
treee960618fe3e508a432ee9b814a387f8bf8c22024 /src/nvim/window.c
parent6f29c68928c3f20d9a1b1a7a311cfac65aa1b4e6 (diff)
parentcd9ca700e5053f8a9666c917310dcc39651e3bfa (diff)
downloadrneovim-79d5f06f79ca2f84a89be3fe2b3d498a72e37a55.tar.gz
rneovim-79d5f06f79ca2f84a89be3fe2b3d498a72e37a55.tar.bz2
rneovim-79d5f06f79ca2f84a89be3fe2b3d498a72e37a55.zip
Merge pull request #23612 from zeertzjq/vim-9.0.0064
vim-patch:9.0.{0064,0218,0249,0490,0492,0598}: cmdwin fixes
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 45a48f13cc..87e936b92f 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -2304,6 +2304,9 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
}
if (hnc) { // add next_curwin size
next_curwin_size -= (int)p_wiw - (m - n);
+ if (next_curwin_size < 0) {
+ next_curwin_size = 0;
+ }
new_size += next_curwin_size;
room -= new_size - next_curwin_size;
} else {
@@ -6686,7 +6689,8 @@ static int win_border_width(win_T *wp)
/// Set the width of a window.
void win_new_width(win_T *wp, int width)
{
- wp->w_width = width;
+ // Should we give an error if width < 0?
+ wp->w_width = width < 0 ? 0 : width;
wp->w_pos_changed = true;
win_set_inner_size(wp, true);
}