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

Behavior of Backspace key #77

Closed
maximbaz opened this issue Apr 18, 2021 · 5 comments · Fixed by #80
Closed

Behavior of Backspace key #77

maximbaz opened this issue Apr 18, 2021 · 5 comments · Fixed by #80

Comments

@maximbaz
Copy link
Contributor

Currently Backspace is not very intuitive:

  1. You open search with / and start typing, you make a typo, press Backspace and uh-oh everything is gone
  2. You open filter with f and start typing, make a typo, press Backspace, and not only all your filters are gone, but even default "hide hidden files" is gone too

What if we leave Backspace with "usual" behavior of removing one char to the left, and instead find a new binding for "clear everything"? Similar to "Ctrl+R" for reset, maybe "Ctrl+L" (like clear in terminal) or "Ctrl+U" (like in some shells, clear a line)?

@sayanarijit
Copy link
Owner

I also feel the same. But not sure if xplr should have readline like features in-built or this should be an extension/plugin.
Or I can only implement the most used features inbuilt.

@maximbaz
Copy link
Contributor Author

Or https://crates.io/crates/rustyline/? 😜

@sayanarijit
Copy link
Owner

But it will require transition to another screen to read input.

@maximbaz
Copy link
Contributor Author

Huh ok, I didn't realize this... In any case I feel like this behavior would confuse every user who will try to filter or search or sort, so maybe it does make sense to have at least basic support built-in, but at the same time try to be pragmatic and don't go completely overboard 🙂

sayanarijit added a commit that referenced this issue Apr 18, 2021
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: #77
sayanarijit added a commit that referenced this issue Apr 18, 2021
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: #77
sayanarijit added a commit that referenced this issue Apr 18, 2021
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: #77
sayanarijit added a commit that referenced this issue Apr 18, 2021
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: #77
sayanarijit added a commit that referenced this issue Apr 18, 2021
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: #77
sayanarijit added a commit that referenced this issue Apr 18, 2021
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: #77
sayanarijit added a commit that referenced this issue Apr 18, 2021
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: #77
sayanarijit added a commit that referenced this issue Apr 18, 2021
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: #77
sayanarijit added a commit that referenced this issue Apr 18, 2021
Add support proper implementations of -

- backspace
- ctrl-w
- ctrl-u

Also, improved sort and filter behavior.

Fixes: #77
@sayanarijit
Copy link
Owner

Hey @maximbaz, I ended up adding support for readline-like input buffer #397.

This should remove a lot of boilerplate code for handling ctrl-w, ctrl-u, backspace etc. Please review if possible.

sayanarijit pushed a commit that referenced this issue Nov 3, 2022
Don't expand path argument, can cause problems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants