Skip to content

Commit 494a578

Browse files
committed
Hook up import completion.
1 parent fe461ab commit 494a578

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bpython/urwid.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
from bpython import args as bpargs, repl
4747
from bpython.formatter import theme_map
48+
from bpython.importcompletion import find_coroutine
4849

4950
import urwid
5051

@@ -479,6 +480,14 @@ def start(main_loop, user_data):
479480
repl.write('\n')
480481
myrepl.start()
481482

483+
# This bypasses main_loop.set_alarm_in because we must *not*
484+
# hit the draw_screen call (it's unnecessary and slow).
485+
def run_find_coroutine():
486+
if find_coroutine():
487+
main_loop.event_loop.alarm(0, run_find_coroutine)
488+
489+
run_find_coroutine()
490+
482491
loop.set_alarm_in(0, start)
483492

484493
loop.run()

0 commit comments

Comments
 (0)