But that doesn't meet the OP's requirement that the solution must leave indentation alone. Yes, pretty-print will put indentation back when you save, but what if the user has unchecked the Clean on Save/Open option(s) or disabled pretty-print altogether? (Did I mention Captain Overkill?

)