Sublime Forum

MATLAB syntax highlighting error (on MAC 10.11.4, build 3114)

#1

Sublime text recognizes “%{” as start of multi-line comment and shows codes below as commented out. But in MATLAB IDE this will not recognized as comment marker. Only “%” and “%%” are legit comment marker.

In above code, I’m not expecting “b = ‘text2’;” to be commented out.

0 Likes

#2

I would recommending trying build 3126 since I believe it has some updates for the Matlab syntax.

If you still see your issue with 3126, open an issue at https://github.com/sublimehq/Packages/issues.

0 Likes

#3
%{

%}

in matlab are block comments, your IDE is not prepared to catch them and apply the block comment syntax correctly as Sublime Text is.

https://www.mathworks.com/matlabcentral/answers/92498-can-i-comment-a-block-of-lines-in-an-matlab-file-using-as-i-can-in-c

Update:

I just remembered, there is a bug the matlab/octave block comments do not allow anything beyond spaces after the %{ opening sign line’s. So, the Sublime Text syntax need to be fixed.

1 Like

#4

I opened a pull request to fix this: https://github.com/sublimehq/Packages/pull/650

0 Likes

#5

Thanks for the fixing!

0 Likes