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

Replace line endings using set_line_ending command #1871

Merged
merged 3 commits into from
Apr 23, 2022

Conversation

kirawi
Copy link
Member

@kirawi kirawi commented Mar 28, 2022

A Transaction is generated to replace all line endings (other than the one your changing it to) in a file. I opted to not create a method for Document since I'm not sure it would ever be used elsewhere, and it would be easy to pull out of the command function if needed.

helix-term/src/commands/typed.rs Outdated Show resolved Hide resolved
@kirawi
Copy link
Member Author

kirawi commented Apr 6, 2022

I think I noticed a bug, or maybe I did something wrong, but for example when you open base16_theme.toml and :line-ending lf it would state there is a change. Pressing u would say it's already at the oldest change, but pressing u again returns it to being unmodified.

@kirawi
Copy link
Member Author

kirawi commented Apr 7, 2022

Apparently base16_theme.toml is CRLF-encoded. I'm not sure about the bug where it says Already at oldest change but still shows the buffer was modified, but I've encountered it in the past during normal editing.

@archseer archseer merged commit dd5a7c6 into helix-editor:master Apr 23, 2022
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.

3 participants