feat: new `ReedlineEvent::PartialComplete` event
Move the partial completion logic from the handling of ReedlineEvent::MenuNext, so that we can fix https://github.com/nushell/nushell/issues/14152 while keeping the following behavior.
When the only valid options are say
fooandfoooo, a typical bash behavior off#tabwould complete the repl text tofoowithout moving the menu item towardsfoooo.
Closes #881
Are there tests we can add for this plus the quick complete section that was removed?
Are there tests we can add for this plus the quick complete section that was removed?
That's a good question.
- I can't find any unit test for reedline events, seems that it is the function behind each event handler that's being tested.
- As for the removed part, I've changed this macro (same for ide_menu.rs) so that existing tests for partial completions shall pass. But I don't think that's good enough. The fact that we have to call
menu.update_valuestwice (one before thecan_partial_completecheck, one inside it) for partial_completion tasks bugs me. I don't know if I can help to optimize it, but that's probably off-topic.
https://github.com/nushell/reedline/blob/22768f3e01523e3a2ea7d521f298909155a22496/src/menu/columnar_menu.rs#L773-L795