Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make 'bind \b suppress-autosuggestion' play nice with the actual deletion #1419

Closed
257 opened this issue Apr 19, 2014 · 7 comments
Closed

make 'bind \b suppress-autosuggestion' play nice with the actual deletion #1419

257 opened this issue Apr 19, 2014 · 7 comments

Comments

@257
Copy link

257 commented Apr 19, 2014

that is to have the first backspace suppress-autosuggestion but not interfere with the actual backspace so that the 2nd backspace starts deleting already typed chars.

@257
Copy link
Author

257 commented May 26, 2014

any updates on this?

@ridiculousfish
Copy link
Member

I think this is a request for the first backspace key to hide the autosuggestion and not delete a character. This would make sense if autosuggestions were automatically accepted on enter, but not with the current design, where an autosuggestion is harmless unless accepted. It would also be sort of weird if backspace did different things depending on whether an autosuggestion is shown. For those reasons we won't ever implement this. Closing, but thanks for sharing your ideas and thoughts.

@257
Copy link
Author

257 commented Nov 10, 2014

as you mentioned this is indeed to be able to suppress the suggestion when user has 'accept-autosuggestion execute'. i don't understand suppress-autosuggestion can to be bound to any key but backspace.[1]
i am not asking for this to be the default behaviour btw. however i would disagree with the "unexpected" argument for the following: this is something that's being used in pretty much any UI that offers autosuggestion that i have encountered. i got the idea from Safari and Google Chrome address bar and also i have seen it implemented in ms windows whereever they have autosuggestion. so this is not some UI that fish is going to come up with.

[1]
EDIT: well this will allow for backspace to be bound to suppress-autosuggestion:

bind -M insert \b suppress-autosuggestion

but that breaks backspace itself in the sense that when there is no suggestion backspace won't delete the chars that are actually typed by the user.

Note: in old school vi mode that may not be a big problem (i could explain if need be).

@ridiculousfish
Copy link
Member

You could add an option to commandline to check if an autosuggestion is shown, and then make a custom binding that either deletes or suppresses the autosuggestion, depending on the state. That seems fine to me.

@257
Copy link
Author

257 commented Nov 10, 2014

could you then reopen this for those interested, please? i don't know much c++ nor have i looked into the code. either of those could change in the future but in the mean time someone might be willing to contribute.

@ridiculousfish
Copy link
Member

Sure

@faho
Copy link
Member

faho commented Sep 26, 2020

Fixed by adding a status to suppress-autosuggestion, so you can use or like so:

bind \b suppress-autosuggestion or backward-delete-char

@faho faho modified the milestones: fish-future, fish 3.2.0 Sep 26, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants