davidvarga / MBeautifier

MBeautifier is a MATLAB source code formatter, beautifier. It can be used directly in the MATLAB Editor and it is configurable.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MBeautifier introduces major sytax errors

casperdcl opened this issue · comments

this is a bug due to running MBeauifier changing stack{end-1} to stack{end -1} and then (incorrectly) to stack{end, -1}. After this happens, if you run MBeautifier a third time, MIndenter/performIndenting errors:

Subscript indices must either be real positive integers or logicals.

Error in MBeautifier.MIndenter/performIndenting (line 93)
                                            if (strcmp(stack{end, -1}, 'function'))
Error in MBeautify.formatFileNoEditor (line 53)
            text = indenter.performIndenting(text);