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
478 stars 75 forks source link

formatEditorSelection indents regions outside selected #110

Open pierslawrence opened 3 years ago

pierslawrence commented 3 years ago

When using MBeautify.formatEditorSelection(), after formatting the selected text, MBeautify.m#L227 then indents the entire editor page, rather than just the selection. I.e. the following code is called:

            MBeautify.indentPage(currentEditorPage, configuration);

It would seem more appropriate to indent only the selected region.