Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Matlab] Fixed the block comment scope for the Matlab syntax #650

Merged
merged 3 commits into from Nov 22, 2016

Conversation

evandrocoan
Copy link
Contributor

@evandrocoan evandrocoan commented Sep 30, 2016

Fixed the block comment scope for the Matlab syntax

Originaly pointed out on:

  1. https://forum.sublimetext.com/t/matlab-syntax-highlighting-error-on-mac-10-11-4-build-3114/23429/2

Tests results after this work:

  1. image

@evandrocoan evandrocoan changed the title Fixed the block comment scope for the Matlab syntax [Matlab] Fixed the block comment scope for the Matlab syntax Sep 30, 2016
evandrocoan added a commit to evandrocoan/ITE that referenced this pull request Sep 30, 2016
@@ -62,7 +62,7 @@ contexts:
scope: comment.double.percentage.matlab
captures:
1: punctuation.definition.comment.matlab
- match: '%\{'
- match: '%\{\s*\n'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex should be (%\{)\s*\n, so that the punctuation scope is applied to the %{.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though not changed by you, the match on line 72 should have () around the %\} also.

@evandrocoan
Copy link
Contributor Author

Updated.

@wbond
Copy link
Member

wbond commented Oct 10, 2016

We should probably also add support for these block comments to https://github.com/sublimehq/Packages/blob/master/Matlab/Miscellaneous.tmPreferences#L35-L40.

@evandrocoan
Copy link
Contributor Author

Added.

@wbond
Copy link
Member

wbond commented Nov 22, 2016

Thanks for these fixes!

@wbond wbond merged commit d2b0502 into sublimehq:master Nov 22, 2016
@evandrocoan
Copy link
Contributor Author

evandrocoan commented Nov 22, 2016

you are welcome. However there is bug I forgot to go after before. Here:

<string>%{\n</string>
...
<string>%}\n</string>

It is obligatory a new line to be inserted, otherwise the the block comment does not work. How could a new line to be inserted?

There is also a missing new line on the opening and the closing does also need new lines:

<string>\n%{\n</string>
...
<string>\n%{\n</string>

I am gonna try:

<string>
%{
</string>
...
<string>
%}
</string>

Take care also when inserting the new files for \n%{\n, to keep %{ correctly indented.


The Syntax

The syntax also need to be fixed to not allow anything than spaces/tabs, before and after the symbols %{ and %}.

@evandrocoan evandrocoan deleted the matlab_block_comments branch November 22, 2016 21:38
@evandrocoan evandrocoan restored the matlab_block_comments branch November 22, 2016 21:38
@evandrocoan evandrocoan deleted the matlab_block_comments branch November 22, 2016 21:38
@evandrocoan evandrocoan restored the matlab_block_comments branch November 23, 2016 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants