if (end_col > screen_Columns) // safety check
end_col = screen_Columns;
if (ScreenLines == NULL
+ || start_row < 0 // should not happen
|| start_row >= end_row
|| start_col >= end_col) // nothing to do
return;
}
// fill the area of TabPanelFill.
- screen_fill_tailing_area(tplmode, row - args.offsetrow, args.maxrow,
+ screen_fill_tailing_area(tplmode, MAX(row - args.offsetrow, 0), args.maxrow,
args.col_start, args.col_end, attr_tplf);
}
call assert_fails(':set tabpanelopt=columns:-1', 'E474:')
endfunc
+func Test_tabpanel_variable_height()
+ CheckFeature tabpanel
+
+ let save_lines = &lines
+ let save_showtabpanel = &showtabpanel
+ let save_tabpanel = &tabpanel
+
+ set lines=10
+ tabnew | tabnew | tabnew | tabnew | tabnew
+
+ let g:tpl_n = 0
+ func! GetTpl() abort
+ let g:tpl_n += 1
+ return g:tpl_n <= 5 ? "x\nx" : "x"
+ endfunc
+
+ set showtabpanel=2
+ let &tabpanel = "%!GetTpl()"
+
+ " Should not crash
+ redraw!
+
+ " Cleanup
+ let &tabpanel = save_tabpanel
+ let &showtabpanel = save_showtabpanel
+ let &lines = save_lines
+ delfunc GetTpl
+ unlet g:tpl_n
+ %bwipeout!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 284,
/**/
283,
/**/