Important
This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.
If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).
Module:terminal.shortcuts.auto_suggest
2 Classes
Bases: Processor
Append the auto suggestion to lines other than the last (appending to the last line is natively supported by the prompt toolkit).
This has a private _debug
attribute that can be set to True to display debug information as virtual suggestion on the end of any line. You can do so with:
>>> from IPython.terminal.shortcuts.auto_suggest import AppendAutoSuggestionInAnyLine >>> AppendAutoSuggestionInAnyLine._debug = True
Apply transformation to the line that is currently being edited.
This is a variation of the original implementation in prompt toolkit that allows to not only append suggestions to any line, but also to show multi-line suggestions.
As transformation are applied on a line-by-line basis; we need to trick a bit, and elide any line that is after the line we are currently editing, until we run out of completions. We cannot shift the existing lines
There are multiple cases to handle:
- The completions ends before the end of the buffer:
We can resume showing the normal line, and say that some code may be hidden.
We can just say that some code may be hidden.
And separately:
We need to both say that some code may be hidden, and that some lines are not shown.
Bases: AutoSuggestFromHistory
A subclass of AutoSuggestFromHistory that allow navigation to next/previous suggestion from history. To do so it remembers the current position, but it state need to carefully be cleared on the right events.
Return None
or a Suggestion
instance.
We receive both Buffer
and Document
. The reason is that auto suggestions are retrieved asynchronously. (Like completions.) The buffer text could be changed in the meantime, but document
contains the buffer document like it was at the start of the auto suggestion call. So, from here, don’t access buffer.text
, but use document.text
instead.
Apply autosuggestion or jump to end of line.
Accept autosuggestion
Discard autosuggestion
Fill partial autosuggestion by word
Fill partial autosuggestion by character
Accept autosuggestion and keep cursor in place
Accept autosuggestion and move cursor left in place
Resume autosuggestions after deleting last character
Resume autosuggestions
Go up and update hint
Go down and update hint
Fill partial autosuggestion by token
Get next autosuggestion from history.
Get previous autosuggestion from history.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4