From 950a88d4c2a9c17b5a679b4e41fab9f64b8cf9df Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 29 Jan 2022 20:37:28 +0800 Subject: vim-patch:8.2.4248: no proper test for moving the window separator Problem: No proper test for moving the window separator. Solution: Add a test. Add comment in code. (closes vim/vim#9656) https://github.com/vim/vim/commit/a0c4e2f2d7aa164d9d7692702c752ea063bd3a8c Remove the assertion as it is now possible for `fr` to be `NULL`. The test fails without clearing messages. Not sure if this is a bug. --- src/nvim/window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/window.c') diff --git a/src/nvim/window.c b/src/nvim/window.c index 1e747a67e9..8e44fd5014 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -5795,7 +5795,6 @@ void win_drag_vsep_line(win_T *dragwin, int offset) } fr = curfr; // put fr at window that grows } - assert(fr); // Not enough room if (room < offset) { @@ -5808,7 +5807,9 @@ void win_drag_vsep_line(win_T *dragwin, int offset) } if (fr == NULL) { - return; // Safety check, should not happen. + // This can happen when calling win_move_separator() on the rightmost + // window. Just don't do anything. + return; } // grow frame fr by offset lines -- cgit