reedline icon indicating copy to clipboard operation
reedline copied to clipboard

feat: new `ReedlineEvent::PartialComplete` event

Open blindFS opened this issue 2 months ago • 2 comments

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 foo and foooo, a typical bash behavior of f#tab would complete the repl text to foo without moving the menu item towards foooo.

Closes #881

blindFS avatar Oct 25 '25 10:10 blindFS

Are there tests we can add for this plus the quick complete section that was removed?

fdncred avatar Oct 25 '25 12:10 fdncred

Are there tests we can add for this plus the quick complete section that was removed?

That's a good question.

  1. I can't find any unit test for reedline events, seems that it is the function behind each event handler that's being tested.
  2. 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_values twice (one before the can_partial_complete check, 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

blindFS avatar Oct 25 '25 13:10 blindFS