diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/testdir/test_window_cmd.vim | 7 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/window.c | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index 771875757d..61daa8d5c2 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -1807,6 +1807,13 @@ function Test_splitkeep_misc() let top = line('w0') help | quit call assert_equal(top, line('w0')) + " No error when resizing window in autocmd and buffer length changed + autocmd FileType qf exe "resize" line('$') + cexpr getline(1, '$') + copen + wincmd p + norm dd + cexpr getline(1, '$') %bwipeout! set splitbelow& diff --git a/src/version.c b/src/version.c index 925cb22fb0..0d3e911e02 100644 --- a/src/version.c +++ b/src/version.c @@ -700,6 +700,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 667, +/**/ 666, /**/ 665, diff --git a/src/window.c b/src/window.c index 79ff5a4269..1f3f9ad668 100644 --- a/src/window.c +++ b/src/window.c @@ -6356,7 +6356,8 @@ win_fix_scroll(int resize) if (wp->w_height != wp->w_prev_height) { // If window has moved update botline to keep the same screenlines. - if (*p_spk == 's' && wp->w_winrow != wp->w_prev_winrow) + if (*p_spk == 's' && wp->w_winrow != wp->w_prev_winrow + && wp->w_botline - 1 <= wp->w_buffer->b_ml.ml_line_count) { lnum = wp->w_cursor.lnum; diff = (wp->w_winrow - wp->w_prev_winrow) |