##// END OF EJS Templates
Use prompt_toolkit's patch_stdout_context when finding completions...
Thomas Kluyver -
Show More
@@ -37,10 +37,14 b' class IPythonPTCompleter(Completer):'
37 if not document.current_line.strip():
37 if not document.current_line.strip():
38 return
38 return
39
39
40 used, matches = self.ipy_completer.complete(
40 # Some bits of our completion system may print stuff (e.g. if a module
41 line_buffer=document.current_line,
41 # is imported). This context manager ensures that doesn't interfere with
42 cursor_pos=document.cursor_position_col
42 # the prompt.
43 )
43 with self.shell.pt_cli.patch_stdout_context():
44 used, matches = self.ipy_completer.complete(
45 line_buffer=document.current_line,
46 cursor_pos=document.cursor_position_col
47 )
44 start_pos = -len(used)
48 start_pos = -len(used)
45 for m in matches:
49 for m in matches:
46 if not m:
50 if not m:
General Comments 0
You need to be logged in to leave comments. Login now