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

Some keywords do not get formatted

cszczepaniak opened this issue · comments

I tried running MBeautify.formatCurrentEditorPage using the default configuration on the following dummy file:

classdef testClass
    properties(SetAccess = immutable)
    end

    methods(Access = public)
        function myFunc(this)
            if(true)
            end
        end
    end
end

Given the default rules shown here:

...
<KeyworPaddingRule>
    <Keyword>if</Keyword>
    <RightPadding>1</RightPadding>
</KeyworPaddingRule>
<KeyworPaddingRule>
    <Keyword>properties</Keyword>
    <RightPadding>1</RightPadding>
</KeyworPaddingRule>
<KeyworPaddingRule>
    <Keyword>methods</Keyword>
    <RightPadding>1</RightPadding>
</KeyworPaddingRule>
...

I expect the formatted output to be:

classdef testClass
    properties (SetAccess = immutable)
    end

    methods (Access = public)
        function myFunc(this)
            if (true)
            end
        end
    end
end

Instead, this is the formatted output:

classdef testClass
    properties(SetAccess = immutable)
    end

    methods(Access = public)
        function myFunc(this)
            if (true)
            end
        end
    end
end

Thanks for submitting the issue - should be fine now.

Thanks!!