Skip to content

Commit

Permalink
Automatic continuous line append for containers #44
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvarga committed Aug 28, 2017
1 parent fef7b0e commit 8a3db2d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions MFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,14 @@
else
containerDepth = containerDepth + obj.calculateContainerDepthDeltaOfLine(trimmedCode);

% Auto append "..." to the lines of continuous containers
if containerDepth && ~(numel(trimmedCode) >= 3 && strcmp(trimmedCode(end - 2:end), '...'))
if strcmp(trimmedCode(end), ',') || strcmp(trimmedCode(end), ';')
actCode = trimmedCode(1:end - 1);
actCode = [trimmedCode, ' ...'];
else
actCode = [actCode, '; ...'];
end
actCode = [actCode, '; ...'];

end

trimmedCode = strtrim(actCode);
Expand Down

0 comments on commit 8a3db2d

Please sign in to comment.