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

Prevent auto-format in auto-save #12817

Merged

Conversation

voiceroy
Copy link
Contributor

@voiceroy voiceroy commented Feb 8, 2025

Fixes #12809

Adds an option in the config file (format-on-auto-save) to configure the formatting on auto save. Setting it to true will format the files on auto save, false (which is the default value) will not format the files on auto save.

Auto saving won't auto format the files now.

helix-view/src/editor.rs Outdated Show resolved Hide resolved
@voiceroy voiceroy force-pushed the auto-save-auto-format-decouple branch from 93bb737 to e38bd9e Compare February 8, 2025 16:34
@voiceroy
Copy link
Contributor Author

voiceroy commented Feb 8, 2025

:wa did not format all files on write if formatting is enabled.

@voiceroy
Copy link
Contributor Author

voiceroy commented Feb 8, 2025

:wa did not format all files on write if formatting is enabled.

Fixed

@voiceroy voiceroy force-pushed the auto-save-auto-format-decouple branch from 448627b to bfa9b1e Compare February 8, 2025 17:01
@voiceroy voiceroy changed the title Provide an option to configure formatting on auto save behavior Provide an option to configure formatting on auto save Feb 9, 2025
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

Let's remove the config option for now and have auto-save always prevent formatting. Setting the option to true would have a confusing effect - it effectively disables auto-save. Once we can auto-save with formatting we can add a config option but in the meantime it will only be confusing.

@voiceroy voiceroy changed the title Provide an option to configure formatting on auto save Auto save will not auto format Feb 11, 2025
This behaviour is not configurable
@voiceroy voiceroy force-pushed the auto-save-auto-format-decouple branch from 406ba8d to 87195d6 Compare February 11, 2025 11:30
@the-mikedavis the-mikedavis changed the title Auto save will not auto format Prevent auto-format in auto-save Feb 12, 2025
@the-mikedavis the-mikedavis merged commit df752bb into helix-editor:master Feb 12, 2025
@voiceroy voiceroy deleted the auto-save-auto-format-decouple branch February 12, 2025 18:15
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.

Decouple the auto-save and auto-format options
4 participants