Skip to content

Commit a676df3

Browse files
allow list_above to be False
1 parent b2ae604 commit a676df3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎bpython/curtsiesfrontend/repl.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,11 @@ def move_screen_up(current_line_start_row):
12771277
potential_space_below = min_height - current_line_end_row - 1
12781278
visible_space_below = potential_space_below - self.get_top_usable_line()
12791279

1280-
info_max_rows = max(visible_space_above, visible_space_below)
1280+
if self.config.curtsies_list_above:
1281+
info_max_rows = max(visible_space_above, visible_space_below)
1282+
else:
1283+
minimum_possible_height = 4
1284+
info_max_rows = max(visible_space_below, minimum_possible_height)
12811285
infobox = paint.paint_infobox(info_max_rows,
12821286
int(width * self.config.cli_suggestion_width),
12831287
self.matches_iter.matches,
@@ -1291,8 +1295,6 @@ def move_screen_up(current_line_start_row):
12911295
else None)
12921296

12931297
if visible_space_below >= infobox.height or not self.config.curtsies_list_above:
1294-
if visible_space_below < infobox.height:
1295-
raise ValueError('whoops %r %r' % (visible_space_below, infobox.height))
12961298
arr[current_line_end_row + 1:current_line_end_row + 1 + infobox.height, 0:infobox.width] = infobox
12971299
else:
12981300
arr[current_line_start_row - infobox.height:current_line_start_row, 0:infobox.width] = infobox

0 commit comments

Comments
 (0)