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

Fix panic in kill_to_end_of_line when handling multibyte characters #12237

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

tm99hjkl
Copy link
Contributor

This PR fixed a panic that occurred when pressing Ctrl-a Ctrl-k in prompts while a multibyte string was inserted.

Before:

b.mp4

After:

a.mp4

@@ -234,8 +234,8 @@ impl Prompt {
}
Movement::StartOfLine => 0,
Movement::EndOfLine => {
Copy link
Member

Choose a reason for hiding this comment

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

I think this branch can just return self.line.len() instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. That worked and I've fixed it.

@tm99hjkl tm99hjkl force-pushed the fix-kill-to-end-of-line branch from 7431de5 to fe08767 Compare December 12, 2024 01:53
@the-mikedavis the-mikedavis merged commit e14c346 into helix-editor:master Dec 13, 2024
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.

2 participants