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
490
stars
77
forks
source link
Indentation broken for some functions on MATLAB R2021b #111
Closed
danielmeer closed 2 years ago
I don't know why but on MATLAB R2021b the call to
editorPage.smartIndentContents();
does not always indent the code correctly.Not all functions are affected:
MBeautify.formatFile()
,MBeautify.formatFileNoEditor()
,MBeautify.formatFiles()
MBeautify.formatCurrentEditorPage()
,MBeautify.formatEditorSelection()
Example:
gets formatted to
Interestingly, the smart indent works correctly if I have the cursor on an empty line.
I found a workaround by calling
editorPage.smartIndentContents();
twice (inMBeautify.indentPage()
). It's not the nicest solution though.