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

feat: replace mode and Vim motions (W, E, B, ^, _) for inputs #2143

Merged
merged 20 commits into from
Jan 8, 2025

Conversation

dxrcy
Copy link
Contributor

@dxrcy dxrcy commented Jan 2, 2025

@@ -11,6 +11,18 @@ impl From<CmdCow> for Opt {

impl Input {
pub fn type_(&mut self, key: &Key) -> bool {
if self.mode() == InputMode::Replace {
let Some(c) = key.plain() else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change back to normal mode for special keys.
Only here to fix <Esc> being handled twice.

yazi-core/src/input/input.rs Outdated Show resolved Hide resolved
@dxrcy

This comment was marked as resolved.

yazi-core/src/input/commands/replace.rs Outdated Show resolved Hide resolved
@boydaihungst
Copy link
Contributor

Can you also improve the way the input component handles deleting characters? I want to be able to see the remaining characters while deleting.

For example, consider a file with a very long name: XXXXX5887_1091036115376980_44076561883236365984_407656188323636598.jpg

image
After deleting all characters except the file extension, it would be better to display XXXXX.jpg. However, I have to exit Insert Mode and then press the Left Arrow or h key to see the remaining characters.

image

@dxrcy dxrcy changed the title Implement more keybinds for inputs feat: more keybinds for inputs Jan 8, 2025
@sxyazi sxyazi changed the title feat: more keybinds for inputs feat: replace mode and Vim motions (W, E, B, ^, _) for inputs Jan 8, 2025
@sxyazi
Copy link
Owner

sxyazi commented Jan 8, 2025

Can you also improve the way the input component handles deleting characters? I want to be able to see the remaining characters while deleting.

@boydaihungst There's already another PR handling this, #1198, but there are still some edge cases with Unicode that need further testing before merging.

Copy link
Owner

@sxyazi sxyazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good to me now, thanks a lot for contributing these awesome features @dxrcy!

@sxyazi sxyazi marked this pull request as ready for review January 8, 2025 10:38
@sxyazi sxyazi merged commit ba62b40 into sxyazi:main Jan 8, 2025
6 checks passed
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 this pull request may close these issues.

Support more vim keybinds
3 participants