From 5d09eb836b265d7c9b4b3e53a2c1977f0433232c Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Fri, 30 Sep 2016 19:08:57 -0300 Subject: [PATCH 1/3] Fixed the block comment scope for the Matlab syntax. --- Matlab/Matlab.sublime-syntax | 2 +- Matlab/syntax_test_matlab.m | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Matlab/Matlab.sublime-syntax b/Matlab/Matlab.sublime-syntax index 4603b9687d..4e21af2a5a 100644 --- a/Matlab/Matlab.sublime-syntax +++ b/Matlab/Matlab.sublime-syntax @@ -62,7 +62,7 @@ contexts: scope: comment.double.percentage.matlab captures: 1: punctuation.definition.comment.matlab - - match: '%\{' + - match: '%\{\s*\n' captures: 1: punctuation.definition.comment.matlab push: diff --git a/Matlab/syntax_test_matlab.m b/Matlab/syntax_test_matlab.m index fa2ffb8c9f..9ba30f9348 100644 --- a/Matlab/syntax_test_matlab.m +++ b/Matlab/syntax_test_matlab.m @@ -56,4 +56,24 @@ +%--------------------------------------------- +% Block comment test + +% Success case +%{ +x = 5 +% ^ source.matlab comment.block.percentage.matlab +%} + +% Failure case +%{ fail +x = 5 +% ^ source.matlab keyword.operator.symbols.matlab +%} + +%{ +%} fail +x = 5 +% ^ source.matlab comment.block.percentage.matlab +%} From 73da0fa5ff0642bb0746f9a496227d0b7d36a745 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Sat, 1 Oct 2016 09:02:17 -0300 Subject: [PATCH 2/3] Added missing capture groups to the Matlab block comments. --- Matlab/Matlab.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Matlab/Matlab.sublime-syntax b/Matlab/Matlab.sublime-syntax index 4e21af2a5a..2590934481 100644 --- a/Matlab/Matlab.sublime-syntax +++ b/Matlab/Matlab.sublime-syntax @@ -62,12 +62,12 @@ contexts: scope: comment.double.percentage.matlab captures: 1: punctuation.definition.comment.matlab - - match: '%\{\s*\n' + - match: '(%\{)\s*\n' captures: 1: punctuation.definition.comment.matlab push: - meta_scope: comment.block.percentage.matlab - - match: '%\}\s*\n' + - match: '(%\})\s*\n' captures: 1: punctuation.definition.comment.matlab pop: true From bd2f4b6693191e3b892012bb733afb39d2bf93bb Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Tue, 11 Oct 2016 19:18:08 -0300 Subject: [PATCH 3/3] Added multi-line comment support on Matlab/Miscellaneous --- Matlab/Miscellaneous.tmPreferences | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Matlab/Miscellaneous.tmPreferences b/Matlab/Miscellaneous.tmPreferences index 9d101b59d6..6e7fc630cd 100644 --- a/Matlab/Miscellaneous.tmPreferences +++ b/Matlab/Miscellaneous.tmPreferences @@ -38,6 +38,18 @@ value % + + name + TM_COMMENT_START_2 + value + %{\n + + + name + TM_COMMENT_END_2 + value + %}\n + smartTypingPairs