There is no solution that I know of so far, but it could likely be implemented as a plugin if someone is interested in doing it.
In the current master branch (future 3.0), there are some options to fix the indentation when saving, but not much more than that.