Skip to content

Commit a66ca9e

Browse files
allow list_above to be False
1 parent e945ea5 commit a66ca9e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bpython/curtsiesfrontend/repl.py

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

1224-
info_max_rows = max(visible_space_above, visible_space_below)
1224+
if self.config.curtsies_list_above:
1225+
info_max_rows = max(visible_space_above, visible_space_below)
1226+
else:
1227+
minimum_possible_height = 4
1228+
info_max_rows = max(visible_space_below, minimum_possible_height)
12251229
infobox = paint.paint_infobox(info_max_rows,
12261230
int(width * self.config.cli_suggestion_width),
12271231
self.matches_iter.matches,
@@ -1234,8 +1238,6 @@ def move_screen_up(current_line_start_row):
12341238
else None)
12351239

12361240
if visible_space_below >= infobox.height or not self.config.curtsies_list_above:
1237-
if visible_space_below < infobox.height:
1238-
raise ValueError('whoops %r %r' % (visible_space_below, infobox.height))
12391241
arr[current_line_end_row + 1:current_line_end_row + 1 + infobox.height, 0:infobox.width] = infobox
12401242
else:
12411243
arr[current_line_start_row - infobox.height:current_line_start_row, 0:infobox.width] = infobox

0 commit comments

Comments
 (0)