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 ctrl-u on insert behavior #1957

Merged
merged 2 commits into from
Apr 23, 2022
Merged

Fix ctrl-u on insert behavior #1957

merged 2 commits into from
Apr 23, 2022

Conversation

pickfire
Copy link
Contributor

@pickfire pickfire commented Apr 4, 2022

Now should follow vim behavior more

  • no longer remove text on cursor
  • no longer remove selected text while inserting
  • first kill to start non-whitespace, start, previous new line

Now should follow vim behavior more
- no longer remove text on cursor
- no longer remove selected text while inserting
- first kill to start non-whitespace, start, previous new line
Comment on lines 684 to 694
let head = if anchor == first_char && line != 0 {
line_end_char_index(&text, line - 1)
} else if let Some(pos) = find_first_non_whitespace_char(text.line(line)) {
if first_char + pos < anchor {
first_char + pos
} else {
first_char
}
} else {
first_char
};
Copy link
Member

Choose a reason for hiding this comment

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

This whole block has no comments and is kind of hard for me to understand what it's doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I thought it was clear enough, added comments now.

@archseer archseer merged commit c1d3d49 into helix-editor:master Apr 23, 2022
@pickfire pickfire deleted the c-u branch April 23, 2022 10:22
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