Skip to content

Commit 8d33d45

Browse files
committed
create a module list when the user hits tab the first time in import completion
1 parent 399692f commit 8d33d45

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bpython/cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,12 @@ def tab(self):
13311331
self.print_line(self.s)
13321332
return True
13331333

1334+
if not importcompletion.modules:
1335+
line = self.s.lstrip()
1336+
if line.startswith('from ') or line.startswith('import '):
1337+
self.statusbar.message('Scanning for modules...')
1338+
importcompletion.reload()
1339+
13341340
if not OPTS.auto_display_list and not self.list_win_visible:
13351341
self.complete(tab=True)
13361342
return True

0 commit comments

Comments
 (0)