einars/js-beautify — pull request #286 by bitwiseman (2013-06-09 08:09:24+00:00)
Title: Minimal indenting

This is a functional initial implementation.

I could reverse this - instead of removing redundant, under indenting and then adding missing when the first newline is added. This would produce less reprocessing of the output in most cases, but that would also make the line wrapping issue noted in #284 even more pronounced. There are simpler ways to improve this such as representing the results as an array of Line objects for quicker access to each location where fix up is needed. Or enhancing that further to have indentation represented by a number instead of characters on each Line. Then modification would be simply changing a number instead of modifying an array.

@einars , @evocateur, unless you object or have feedback, in a couple of days I'll push this change and file an issue to revisit and improve this design later.

Closes #281.