On 02/03/07, harningt <[EMAIL PROTECTED]> wrote:
>
>
> Tsz Ming WONG wrote:
> >
> > maybe
> >
> > http://astyle.sourceforge.net/ ?
> >
> > you might need to tweak the settings for javascript.
> >
> >
> This seems the ideal tool to me, however it completely screws up when
> dealing w/ function creation..
> Ex:
> /* Desired target for where I work (I prefer inline braces, since it wastes
> less space, but I digress.) */
> var x = function()
> {
>   return function()
>   {
>     return 0;
>   }
> };
>
> Astyle likes to format in this matter:
> var x = function()
>           {
>              return function()
>                       {
>                           return 0;
>                       }
>           }
> Which is horrible.. increases nesting depth insanely.
> (may not show up right because I'm editing in Nabble's text-area
> --

I find it also inserts spaces even though I tell it not to:
AStyle.exe -beyFTE myfile.js

It's a shame there are no free command line utilities (that don't have
a bug like that) for code formatting like how Visual Studio can do it
(specifying spaces or tabs, brackets on newlines or not, etc). Tidy
works with HTML, but you can't tell it to use tabs instead (i.e. the
developer(s) is basically forcing his coding style onto the users of
the software), it complains about malformed documents, and it outputs
more than just the tidied HTML when it is finished.

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to