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

Single completion add blank only at end #214

Open
tkruse opened this issue Sep 3, 2015 · 3 comments
Open

Single completion add blank only at end #214

tkruse opened this issue Sep 3, 2015 · 3 comments

Comments

@tkruse
Copy link
Contributor

tkruse commented Sep 3, 2015

The CandidateListCompletionHandler has an option to add a blank after a single full completion. However the code limits this to situations where the cursor is at the end of the buffer. I believe the behavior should be the same when the cursor is anywhere in the buffer. This also requires some more attention to the existing chars in the buffer, to avoid creating a second blank where one existed already.

@gnodet
Copy link
Member

gnodet commented Sep 3, 2015

I think we need to make that easily pluggable / configurable.
I've currently tried to mimic bash behaviour, but zsh behaves differently for example.

@tkruse
Copy link
Contributor Author

tkruse commented Sep 3, 2015

I find that there are almost endless possibilities to configure corner cases in completion. Providing switches for each alternative would make things very confusing and would allow for many bugs. So I would suggest for jline to generally provide only a single best-effort alternative, and allow variations via subclassing. In my PR #215 I can add some protected method calls to make overriding the behavior easier.

@tkruse
Copy link
Contributor Author

tkruse commented Sep 3, 2015

In #215 I added a commit that uses two protected methods to change the default behavior.

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

2 participants