Add option to customize insertion points for completions #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixed #53
By using this feature, we can complete items which is not only separated by space. For example, we can complete files on your local machine like:
What should we define as default word separators
In #66, Chyroc suggest that "," should have the same effect with
. I checked bash-shell's word separator by running
Ctrl + W
(Cut the word before the cursor) after input following text which includesspace
,comma
,period
,colon
,semi-colon
andem space
.then
Ctrl + W
removes until space. The result is below:From this behavior, I think we should only set
space
as a default word separator. This is the same as ever.Interface design (still not implemented)
There is the scene to customize word separator.
Add
prompt.OptionCompletionWordSeparator(x string)
for #53 and #61.These methods are used when we want to change the insertion points for completer.
Provide text query functions by arbitrary word separator for #66
These methods are available from KeyBind functions like: