Make `astyle` under `:ALEFix` operate on buffer
Previously, :ALEFix made astyle operate on the disk file, and populated the buffer with the results, potentially losing work.
This PR regresses #3257, but that appears to be a bug with astyle itself, not with ale, so it should be fixed there anyways. I feel avoiding data-loss should be a higher goal than working around astyle bugs.
Thanks for your awesome work!
@jhlink Steps to reproduce:
- Ensure
astyleis the only ALE fixer defined for C. - Open a
.cfile with valid C code. - Add a line of valid C code anywhere in the file.
- Run
:ALEFix - Observe that the added line has vanished.
Took some time to re-read the related discussions and test this PR and unfortunately applying this PR reverts the initial issue. If we do not use the --stdin flag then astyle fails to find and use any .astylerc or _astylerc configuration files within the project. This would be a breaking change so I cannot approve this PR unless alternative solution for the .astylerc/_astylerc file issue is also included.
Thanks for helping with the analysis @hsanson !
This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See :help ale-dev for information on writing tests.
If your pull request is good to merge, bother w0rp or another maintainer again, and get them to merge it.