Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement tab completion #2

Open
alextsui05 opened this issue Aug 19, 2014 · 2 comments
Open

Implement tab completion #2

alextsui05 opened this issue Aug 19, 2014 · 2 comments

Comments

@alextsui05
Copy link
Owner

Hitting tab should fill the console with potential autocompletions like the interactive python interpreter does if you have it set up to do so.

@alextsui05
Copy link
Owner Author

This can be implemented using an rlcompleter.Completer. Call complete with a partial string and int n to get the n-th possible completion. Sometimes there's only one, in which case just complete it. Sometimes there's more, so gather it in a list and format it neatly as a message to print to the console.

@alextsui05
Copy link
Owner Author

Pressing tab should autocomplete with the largest common substring of all the current suggestions. In the case where there is only one suggestion, it completes the whole thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant