Skip to content

Commit 66c5771

Browse files
move new variables to parameters
1 parent 9a371d7 commit 66c5771

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,14 +1251,20 @@ def current_output_line(self, value):
12511251
self.current_stdouterr_line = ''
12521252
self.stdin.current_line = '\n'
12531253

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):
12551257
"""Returns an array of min_height or more rows and width columns, plus
12561258
cursor position
12571259
12581260
Paints the entire screen - ideally the terminal display layer will take
12591261
a diff and only write to the screen in portions that have changed, but
12601262
the idea is that we don't need to worry about that here, instead every
12611263
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.
12621268
"""
12631269
# The hairiest function in the curtsies
12641270
if about_to_exit:
@@ -1412,15 +1418,12 @@ def move_screen_up(current_line_start_row):
14121418
else:
14131419
# Logic for determining size of completion box
14141420
# 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
14181421
preferred_height = max(
14191422
# always make infobox at least this height
1420-
minimum_possible_height,
1423+
min_infobox_height,
14211424

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
14241427
min_height - try_preserve_history_height)
14251428

14261429
info_max_rows = min(max(visible_space_below,

0 commit comments

Comments
 (0)