davidvarga / MBeautifier

MBeautifier is a MATLAB source code formatter, beautifier. It can be used directly in the MATLAB Editor and it is configurable.
GNU General Public License v3.0
476 stars 75 forks source link

Indentation in multiline condition. #52

Open mike-live opened 6 years ago

mike-live commented 6 years ago

I assume that in the case of a condition, it is better to align to condition on previous line. I think this code:

if a + b > 0 && ...
   a * b > 0
    a = b;
end   

better than generated by MBeautifier:

if a + b > 0 && ...
        a * b > 0
    a = b;
end

So, this is true for while too.

davidvarga commented 6 years ago

The problem here is the same that with #51 : it relies on Smart Indent functionality of editor. Maybe in v2.0alpha this can be implemented.

orwel1984 commented 5 years ago

is it possible to replace multiline by in-lining instead? how to set such a configuration ?

davidvarga commented 5 years ago

The inlining of continous lines (...) would be theoreti cally possible to be implemented (currently it is not implemented). I open a separate card for it.

EDIT: Done - #58.

davidvarga commented 5 years ago

The in-lining has been implemented in #58 : it is disabled by default though.