Return true if there was an autosuggestion to accept#10608
Return true if there was an autosuggestion to accept#10608diniamo wants to merge 3 commits intofish-shell:masterfrom diniamo:accept-autosuggestion-return-true
Conversation
CHANGELOG.rst
Outdated
| - ``read --help`` and friends no longer ignore redirections. This fixes a regression in version 3.1 (:issue:`10274`). | ||
| - Measuring a command with ``time`` now considers the time taken for command substitution (:issue:`9100`). | ||
| - ``fish_add_path`` now automatically enables verbose mode when used interactively (in the commandline), in an effort to be clearer about what it does (:issue:`10532`). | ||
| - The `accept-autosuggestion` input function now returns true when there was something to accept. |
There was a problem hiding this comment.
Pedantically, I think the real meat of the change is that it now returns false if there wasn't something to accept.
mqudsi
left a comment
There was a problem hiding this comment.
I left a comment about changing the documentation to be "returns true when.." to "returns false when..", if you don't mind changing that.
It would also be nice for this to be accompanied by a test. You can probably model this directly off the recent addition of a pexpect test for commandline --showing-suggestion.
|
I'm really not sure how to write the test, so I would appreciate it if someone did it for me. |
|
In what context are you using this? Can you give an example of how you are invoking this input function? (relevant for how the status code is returned) |
bind -M insert -k nul accept-autosuggestion and executeis what I would be doing. |
|
Thanks! |
|
going through the changelog I realized we already have |
Description
Return true from
accept-autosuggestionif there was an autosuggestion to accept, just likesuppress-autosuggestion.TODOs: