@@ -1251,14 +1251,20 @@ def current_output_line(self, value):
1251
1251
self .current_stdouterr_line = ''
1252
1252
self .stdin .current_line = '\n '
1253
1253
1254
- def paint (self , about_to_exit = False , user_quit = False ):
1254
+ def paint (self , about_to_exit = False , user_quit = False ,
1255
+ try_preserve_history_height = 40 ,
1256
+ min_infobox_height = 4 ):
1255
1257
"""Returns an array of min_height or more rows and width columns, plus
1256
1258
cursor position
1257
1259
1258
1260
Paints the entire screen - ideally the terminal display layer will take
1259
1261
a diff and only write to the screen in portions that have changed, but
1260
1262
the idea is that we don't need to worry about that here, instead every
1261
1263
frame is completely redrawn because less state is cool!
1264
+
1265
+ try_preserve_history_height is the the number of rows of content that
1266
+ must be visible before the suggestion box scrolls the terminal in order
1267
+ to display more than min_infobox_height rows of suggestions, docs etc.
1262
1268
"""
1263
1269
# The hairiest function in the curtsies
1264
1270
if about_to_exit :
@@ -1412,15 +1418,12 @@ def move_screen_up(current_line_start_row):
1412
1418
else :
1413
1419
# Logic for determining size of completion box
1414
1420
# smallest allowed over-full completion box
1415
- minimum_possible_height = 4
1416
- # smallest amount of history that must be visible
1417
- try_preserve_history_height = 40
1418
1421
preferred_height = max (
1419
1422
# always make infobox at least this height
1420
- minimum_possible_height ,
1423
+ min_infobox_height ,
1421
1424
1422
- # there's so much space that we can preserve
1423
- # this much history and still expand the infobox
1425
+ # use this value if there's so much space that we can
1426
+ # preserve this try_preserve_history_height rows history
1424
1427
min_height - try_preserve_history_height )
1425
1428
1426
1429
info_max_rows = min (max (visible_space_below ,
0 commit comments