Open mlucool opened 5 years ago
Hi @mlucool,
This totally makes sense to have, but is unfortunately not yet available in prompt_toolkit. It can be done though, let's take this as a feature request.
@jonathanslenders I'm interested in this as well. Where in the code would a change need to be made to make this happen?
Would modifying _trim_formatted_text
in prompt_toolkit\layout\menus.py work as a solution to option 2 listed above?
Ellipsis the start not the end of the string
(The original https://github.com/prompt-toolkit/python-prompt-toolkit/issues/909#issue-450548763 May30 request came from me.)
1. Allow the part already typed to not be included
Clarifying the above approach1: Suppose:
It would be nice for the prompt_toolkit completer to only show bar1, bar2, bar3; don't try to show foo1.foo2.foo3.foo4.foo5.foo6.bar1, foo1.foo2.foo3.foo4.foo5.foo6.bar2, foo1.foo2.foo3.foo4.foo5.foo6.bar3
We propose to show only the completion names, instead of repeating the entire input string.
This approach1 doesn't handle single names that are really long; that could still be handled by approach2 (ellipsis the start) in addition to approach1.
Sidenote, the example at the top will not work on Py3, because it tries to decode a string (which Python 2 does because f casting)
https://github.com/ipython/ipython/pull/12284 does some of that on the IPython side.
Hi,
If I have a long name I am trying to autocomplete, this no longer is useful. Would it be possible to allow for one of the following:
While below is contrived, this happens with autocomplete of long chains of properties. Reproducer:
Python 2.7.15 IPython 5.8.0 PromptToolkit: 1.0.15
Please also let me know if this is available in a later version of prompt_toolkit.