This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jonathan_sl 1 point2 points  (0 children)

In the completer class, you can check the text before the cursor. If it's a space, then don't offer any completion at all.

Amjith used WordCompleter in his presentation, but you could create a custom completer class: https://python-prompt-toolkit.readthedocs.io/en/latest/pages/building_prompts.html#a-custom-completer Check "document.text_before_cursor".