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
483 stars 77 forks source link

Exception when formatting a selection at the start of the file. #89

Closed VorpalBlade closed 4 years ago

VorpalBlade commented 4 years ago

Using R2019B, I get the following when using the "format selection" functionality, if the selection starts anywhere in the first line of the editor window:

Undefined function or variable 'lineBeforePosition'.

Error in MBeautify.formatEditorSelection (line 137)
            expandedSelection = [lineBeforePosition(1), 1, expandedSelection(3), Inf];

137             expandedSelection = [lineBeforePosition(1), 1, expandedSelection(3), Inf];
davidvarga commented 4 years ago

Hi,

with the referenced commit the problem should be solved.