bash-completion icon indicating copy to clipboard operation
bash-completion copied to clipboard

[Need discussion (cf #814)] refactor(_command_offset): implement Bash's $2 passed to completion functions

Open akinomyoga opened this issue 1 year ago • 3 comments

This includes a fix of #790, the renaming of the functions _command_offset, _command, and _root_command as suggested in #539, and also other refactorings.

  • c59655c4 fix #790: This mimics the behavior of Bash that I observed in tests. The rule of modifying the current word is described in the code comments of _comp_command_offset__reduce_cur.

Fixes #790

Edit: I have separated changes to other PRs: #796, #797, #798, and #799.

akinomyoga avatar Aug 27 '22 02:08 akinomyoga

Thank you. I'll split the PR.

akinomyoga avatar Sep 03 '22 10:09 akinomyoga

The rest of the refactorings/cleanups here are quite understandable and nice, I'd be happy to work on getting them merged first, and see about the actual fix for #790 i.e. c59655c separately.

I have completed splitting the PR. #796, #797, #798, and #799. This PR actually depends on the change in #798, so the test of this PR will now fail. Also, this PR conflicts with the change in #799. I thought #797 would also conflict with the change remaining in this PR, but #797 turned out to be actually independent. Edit: For the sake of completeness, this PR also conflicts with #793. If this PR is merged first, maybe I'll resolve the conflicts.

akinomyoga avatar Sep 03 '22 12:09 akinomyoga

I have created an alternative fix at PR #814 to discuss which approach is better.

akinomyoga avatar Sep 11 '22 06:09 akinomyoga

Closing in favor of #814.

akinomyoga avatar Sep 18 '22 23:09 akinomyoga