Skip to content

completion box size changes based on terminal size #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test suggestion box behavior before/after #466.
  • Loading branch information
thomasballinger committed Aug 5, 2016
commit aa4ff4273736fed0a6bbbc3ec9414032be7ecc42
4 changes: 2 additions & 2 deletions bpython/curtsiesfrontend/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,8 +1252,8 @@ def current_output_line(self, value):
self.stdin.current_line = '\n'

def paint(self, about_to_exit=False, user_quit=False,
try_preserve_history_height=40,
min_infobox_height=4):
try_preserve_history_height=30,
min_infobox_height=5):
"""Returns an array of min_height or more rows and width columns, plus
cursor position

Expand Down
28 changes: 26 additions & 2 deletions bpython/test/test_curtsies_painting.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,19 @@ def test_lower_on_screen(self):
'| k |',
'| l |',
'+------------------+']
self.assert_paint_ignoring_formatting(screen, (0, 8))
# behavior before issue #466
self.assert_paint_ignoring_formatting(
screen, try_preserve_history_height=0)
self.assert_paint_ignoring_formatting(
screen, min_infobox_height=100)
# behavior after issue #466
screen = ['>>> abc.',
'+------------------+',
'| aaaaaaaaaaaaaaaa |',
'| b |',
'| c |',
'+------------------+']
self.assert_paint_ignoring_formatting(screen)

def test_at_bottom_of_screen(self):
self.repl.get_top_usable_line = lambda: 17 # two lines from bottom
Expand All @@ -720,4 +732,16 @@ def test_at_bottom_of_screen(self):
'| k |',
'| l |',
'+------------------+']
self.assert_paint_ignoring_formatting(screen, (0, 8))
# behavior before issue #466
self.assert_paint_ignoring_formatting(
screen, try_preserve_history_height=0)
self.assert_paint_ignoring_formatting(
screen, min_infobox_height=100)
# behavior after issue #466
screen = ['>>> abc.',
'+------------------+',
'| aaaaaaaaaaaaaaaa |',
'| b |',
'| c |',
'+------------------+']
self.assert_paint_ignoring_formatting(screen)