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

Allow tab-completion only at the end of line and replace magic number #57

Closed
wants to merge 2 commits into from

Conversation

devurandom
Copy link

Currently tab-completion may take place at arbitrary cursor positions, but there is no way to figure out the cursor position from within the line completion code, effectively preventing sensible completion at that place. Hence I limited tab-completion to the end of line, to prevent user confusion.

I also replaced the magic 9 in that line with '\t'.

A similar patch was merged to msteveb's repository as msteveb#2

A similar patch was merged to msteveb's repository as msteveb#2
Currently tab-completion may take place at arbitrary cursor positions, but there is no way to figure out the cursor position from within the line completion code, effectively preventing sensible completion at that place. Hence I limited tab-completion to the end of line, to prevent user confusion.

A similar patch was merged to msteveb's repository as msteveb#2
@devurandom devurandom changed the title Replace magic number 9 with '\t' in linenoisePrompt() Allow tab-completion only at the end of line and replace magic number Mar 19, 2014
@devurandom devurandom closed this Mar 19, 2014
@devurandom devurandom deleted the patch-1 branch March 19, 2014 18:14
@w32zhong
Copy link

w32zhong commented Apr 18, 2016

I move a step further to achieve completion in anywhere of the line, yes, getting cursor position is very important here. See #32 for my comment.

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

Successfully merging this pull request may close these issues.

2 participants