nushell / reedline

A feature-rich line editor - powering Nushell
https://docs.rs/reedline/
MIT License
549 stars 152 forks source link

Autocomplete: recognize when user removed a completion, and suggest other #309

Open danimesq opened 2 years ago

danimesq commented 2 years ago

For example, I type:

git push it autocompletes origin; forming: git push origin.

Done! Pushed to origin.

But then I input and it is git push origin. Then I remove origin, but it still marks/suggests origin; suggestion: In this case, display the next last used to autocomplete, in this case it autocompletes github, forming: git push github.

fdncred commented 2 years ago

I'm not sure how much of the completions we actually control. Most of these come from rustyline, the line editor we use. However, we're hopeful to be using our new linefeed line editor in the next major version of nushell, which is what we're mostly focused on in the engine-q repo.

sholderbach commented 2 years ago

I'm gonna transfer this to reedline as we would be able to solve it there. Implementing it will certainly introduce some additional complexity to track the state of deleted entries to advance through the history autosuggestion hints.