0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 9.0.0667: ml_get error when 'splitkeep' is "screen"

Problem:    ml_get error when 'splitkeep' is "screen". (Marius Gedminas)
Solution:   Check the botline is not too large. (Luuk van Baal,
            closes #11293, closes #11292)
This commit is contained in:
Luuk van Baal
2022-10-05 18:26:42 +01:00
committed by Bram Moolenaar
parent 7beaf6a720
commit 346823d3e5
3 changed files with 11 additions and 1 deletions

View File

@@ -1807,6 +1807,13 @@ function Test_splitkeep_misc()
let top = line('w0') let top = line('w0')
help | quit help | quit
call assert_equal(top, line('w0')) 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! %bwipeout!
set splitbelow& set splitbelow&

View File

@@ -699,6 +699,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
667,
/**/ /**/
666, 666,
/**/ /**/

View File

@@ -6356,7 +6356,8 @@ win_fix_scroll(int resize)
if (wp->w_height != wp->w_prev_height) if (wp->w_height != wp->w_prev_height)
{ {
// If window has moved update botline to keep the same screenlines. // 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; lnum = wp->w_cursor.lnum;
diff = (wp->w_winrow - wp->w_prev_winrow) diff = (wp->w_winrow - wp->w_prev_winrow)