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

Completion with cursor inside argument #207

Open
tkruse opened this issue Aug 20, 2015 · 1 comment
Open

Completion with cursor inside argument #207

tkruse opened this issue Aug 20, 2015 · 1 comment

Comments

@tkruse
Copy link
Contributor

tkruse commented Aug 20, 2015

HI,

There are multiple alternatives to consider when completing an Argument with the cursor not being at the end of the line/argument.

Consider a command load that takes a Filename, assume there is a file project/LICENSE, the | indicates the cursor position:

load project/LICE|XXX
# possible situations after hitting tab
load project/LICENSE |XXX
load project/LICENSE

When the suffix matches the candidate, there are these possibilities:

load project/LICE|NS
# possible situations after hitting tab
load project/LICENSE |NS
load project/LICENSE |

Different completion frameworks do this differently (compare bash, ipython, Eclipse, IntelliJ)

I believe both strategies can be considered useful, so it would be nice if JLine supported both. I might have time to work on a PR, but first I want to check whether this is considered a good idea.

@gnodet
Copy link
Member

gnodet commented Sep 2, 2015

This looks like the precise role of the CompletionHandler.
I don't have any problem adding a flag to the existing handler or defining a new one.

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