Skip to content

Commit d0649a5

Browse files
authored
Merge pull request ipython#12570 from mskar/auto_suggest
2 parents e2283d6 + a5f1b68 commit d0649a5

11 files changed

+84
-12
lines changed

IPython/terminal/interactiveshell.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
Float,
2828
)
2929

30+
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
3031
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
3132
from prompt_toolkit.filters import (HasFocus, Condition, IsDone)
3233
from prompt_toolkit.formatted_text import PygmentsTokens
@@ -353,18 +354,20 @@ def prompt():
353354

354355
self.pt_loop = asyncio.new_event_loop()
355356
self.pt_app = PromptSession(
356-
editing_mode=editing_mode,
357-
key_bindings=key_bindings,
358-
history=history,
359-
completer=IPythonPTCompleter(shell=self),
360-
enable_history_search = self.enable_history_search,
361-
style=self.style,
362-
include_default_pygments_style=False,
363-
mouse_support=self.mouse_support,
364-
enable_open_in_editor=self.extra_open_editor_shortcuts,
365-
color_depth=self.color_depth,
366-
tempfile_suffix=".py",
367-
**self._extra_prompt_options())
357+
auto_suggest=AutoSuggestFromHistory(),
358+
editing_mode=editing_mode,
359+
key_bindings=key_bindings,
360+
history=history,
361+
completer=IPythonPTCompleter(shell=self),
362+
enable_history_search=self.enable_history_search,
363+
style=self.style,
364+
include_default_pygments_style=False,
365+
mouse_support=self.mouse_support,
366+
enable_open_in_editor=self.extra_open_editor_shortcuts,
367+
color_depth=self.color_depth,
368+
tempfile_suffix=".py",
369+
**self._extra_prompt_options()
370+
)
368371

369372
def _make_style_from_name_or_cls(self, name_or_cls):
370373
"""
4.62 KB
Loading
14 KB
Loading
17.1 KB
Loading
4.83 KB
Loading
6.45 KB
Loading
3.58 KB
Loading
4.07 KB
Loading
853 Bytes
Loading
7.42 KB
Loading

0 commit comments

Comments
 (0)