Skip to content

Commit 5550217

Browse files
committed
make import completion coroutine tell the idle function when it is still
searching, and have idle function ungetch() to allow it to continue searching
1 parent 645df4c commit 5550217

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

bpython/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,8 @@ def idle(caller):
17321732

17331733
global stdscr
17341734

1735-
importcompletion.find_coroutine()
1735+
if importcompletion.find_coroutine():
1736+
curses.ungetch('')
17361737
caller.statusbar.check()
17371738

17381739
if DO_RESIZE:

bpython/importcompletion.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ def find_coroutine():
103103
global fully_loaded
104104

105105
if fully_loaded:
106-
return
106+
return None
107107

108108
try:
109109
find_iterator.next()
110110
except StopIteration:
111111
fully_loaded = True
112112

113+
return True
114+
113115
def reload():
114116
"""Refresh the list of known modules."""
115117
modules.clear()

0 commit comments

Comments
 (0)