Skip to content

Commit d758402

Browse files
committed
AssertionError less if the tooltip does not fit on the screen.
Spotted and debugged by Trundle.
1 parent 494a578 commit d758402

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bpython/urwid.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,13 @@ def main(args=None, locals_=None, banner=None):
417417
config.pastebin_key, config.last_output_key,
418418
config.show_source_key))
419419

420+
# XXX this is not great: if the tooltip is too large the bottom line
421+
# of the LineBox gets eaten. That should not happen, and there
422+
# should be a nice indicator that the Edit widget is truncated.
420423
tooltiptext = urwid.Text('')
421-
overlay = Tooltip(urwid.LineBox(tooltiptext), listbox,
422-
'left', ('relative', 100), ('fixed top', 0), None)
424+
overlay = Tooltip(urwid.Filler(urwid.LineBox(tooltiptext)), listbox,
425+
'left', ('relative', 100),
426+
('fixed top', 0), ('relative', 50))
423427

424428
frame = urwid.Frame(overlay, footer=statusbar.widget)
425429

0 commit comments

Comments
 (0)