Skip to content

Commit 8bd9216

Browse files
committed
Merge branch 'st4-develop'
2 parents 1df39dc + e620a3c commit 8bd9216

File tree

4 files changed

+238
-30
lines changed

4 files changed

+238
-30
lines changed

plugins/view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class MdeCenteredLineKeeper(MdeViewEventListener):
9595

9696
def on_modified(self):
9797
sel = self.view.sel()
98-
if sel and len(sel) != 1:
98+
if not sel or len(sel) != 1:
9999
return
100100

101101
settings = self.view.settings()

syntaxes/Code Block Syntaxes.sublime-completions

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,20 @@
664664
"details": "Specifies <code>SQL</code> code highlighting"
665665
},
666666

667+
// WASM
668+
{
669+
"trigger": "wast",
670+
"annotation": "WAST",
671+
"kind": ["markup", "s", "Syntax"],
672+
"details": "Specifies <code>WebAssembly Text</code> code highlighting"
673+
},
674+
{
675+
"trigger": "wit",
676+
"annotation": "WIT",
677+
"kind": ["markup", "s", "Syntax"],
678+
"details": "Specifies <code>WabAssembly Interface Type</code> code highlighting"
679+
},
680+
667681
// XML
668682
{
669683
"trigger": "atom",

syntaxes/Markdown.sublime-syntax

Lines changed: 75 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -50,55 +50,58 @@ variables:
5050
5151
backticks: |-
5252
(?x:
53-
(`{4})(?![\s`])(?:[^`]+(?=`)|(?!`{4})`+(?!`))+(`{4})(?!`) # 4 backticks, followed by at least one non whitespace, non backtick character, followed by (less than 4 backticks, or at least one non backtick character) at least once, followed by exactly 4 backticks
54-
| (`{3})(?![\s`])(?:[^`]+(?=`)|(?!`{3})`+(?!`))+(`{3})(?!`) # 3 backticks, followed by at least one non whitespace, non backtick character, followed by (less than 3 backticks, or at least one non backtick character) at least once, followed by exactly 3 backticks
55-
| (`{2})(?![\s`])(?:[^`]+(?=`)|(?!`{2})`+(?!`))+(`{2})(?!`) # 2 backticks, followed by at least one non whitespace, non backtick character, followed by (less than 2 backticks, or at least one non backtick character) at least once, followed by exactly 2 backticks
56-
| (`{1})(?![\s`])(?:[^`]+(?=`)|(?!`{1})`+(?!`))+(`{1})(?!`) # 1 backtick, followed by at least one non whitespace, non backtick character, followed by ( at least one non backtick character) at least once, followed by exactly 1 backtick
53+
(`{4})[^`](?:[^`]|(?!`{4})`+[^`])*(`{4})(?!`) # 4 backticks, followed by at least one non backtick character, followed by (less than 4 backticks, or at least one non backtick character) at least once, followed by exactly 4 backticks
54+
| (`{3})[^`](?:[^`]|(?!`{3})`+[^`])*(`{3})(?!`) # 3 backticks, followed by at least one non backtick character, followed by (less than 3 backticks, or at least one non backtick character) at least once, followed by exactly 3 backticks
55+
| (`{2})[^`](?:[^`]|(?!`{2})`+[^`])*(`{2})(?!`) # 2 backticks, followed by at least one non backtick character, followed by (less than 2 backticks, or at least one non backtick character) at least once, followed by exactly 2 backticks
56+
| (`{1})[^`](?:[^`]|(?!`{1})`+[^`])*(`{1})(?!`) # 1 backtick, followed by at least one non backtick character, followed by ( at least one non backtick character) at least once, followed by exactly 1 backtick
5757
)
5858
escapes: \\[-+*/!"#$%&'(),.:;<=>?@\[\\\]^_`{|}~]
5959

6060
balance_square_brackets: |-
6161
(?x:
6262
(?:
63-
(?:{{escapes}})+ # escape characters
64-
| [^\[\]`\\]+(?=[\[\]`\\]|$) # anything that isn't a square bracket or a backtick or the start of an escape character
63+
\\. # maybe escaped character (be lazy)
64+
| [^\[\]`] # anything that isn't a square bracket or backtick
6565
| {{backticks}} # inline code
66-
| \[(?: # nested square brackets (one level deep)
67-
[^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick
68-
{{backticks}}? # balanced backticks
69-
)*\] # closing square bracket
66+
| \[ (?: # nested square brackets (one level deep)
67+
\\. # maybe escaped character (be lazy)
68+
| [^\[\]`] # anything that isn't a square bracket or backtick
69+
| {{backticks}} # inline code
70+
)* \] # closing square bracket
7071
)+
7172
)
7273
balance_square_brackets_and_emphasis: |-
7374
(?x:
7475
(?:
75-
(?:{{escapes}})+ # escape characters
76-
| [^\[\]`\\_*]+(?=[\[\]`\\_*]|$) # anything that isn't a square bracket, a backtick, the start of an escape character, or an emphasis character
76+
\\. # maybe escaped character (be lazy)
77+
| [^\[\]`_*] # anything that isn't a square bracket, backtick or emphasis
7778
| {{backticks}} # inline code
78-
| \[(?: # nested square brackets (one level deep)
79-
[^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick
80-
{{backticks}}? # balanced backticks
81-
)*\] # closing square bracket
79+
| \[ (?: # nested square brackets (one level deep)
80+
\\. # maybe escaped character (be lazy)
81+
| [^\[\]`_*] # anything that isn't a square bracket, backtick or emphasis
82+
| {{backticks}} # inline code
83+
)* \] # closing square bracket
8284
)+ # at least one character
8385
)
8486
balance_square_brackets_pipes_and_emphasis: |-
8587
(?x:
8688
(?:
87-
(?:{{escapes}})+ # escape characters
88-
| [^\[\]`\\_*|]+(?=[\[\]`\\_*|]|$) # anything that isn't a square bracket, a backtick, the start of an escape character, or an emphasis character
89+
\\. # maybe escaped character (be lazy)
90+
| [^\[\]`_*|] # anything that isn't a square bracket, backtick or emphasis or table cell separator
8991
| {{backticks}} # inline code
90-
| \[(?: # nested square brackets (one level deep)
91-
[^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick
92-
{{backticks}}? # balanced backticks
93-
)*\] # closing square bracket
92+
| \[ (?: # nested square brackets (one level deep)
93+
\\. # maybe escaped character (be lazy)
94+
| [^\[\]`_*|] # anything that isn't a square bracket, backtick or emphasis or table cell separator
95+
| {{backticks}} # inline code
96+
)* \] # closing square bracket
9497
)+ # at least one character
9598
)
9699
balanced_emphasis: |-
97100
(?x:
98-
\* (?!\*){{balance_square_brackets_and_emphasis}}+\* (?!\*)
99-
| \*\* {{balance_square_brackets_and_emphasis}}+\*\*
100-
| _ (?!_) {{balance_square_brackets_and_emphasis}}+_ (?!_)
101-
| __ {{balance_square_brackets_and_emphasis}}+__
101+
\* (?!\*){{balance_square_brackets_and_emphasis}}\* (?!\*)
102+
| \*\* {{balance_square_brackets_and_emphasis}}\*\*
103+
| _ (?!_) {{balance_square_brackets_and_emphasis}}_ (?!_)
104+
| __ {{balance_square_brackets_and_emphasis}}__
102105
)
103106
104107
table_cell: |-
@@ -1182,6 +1185,8 @@ contexts:
11821185
- include: fenced-twee
11831186
- include: fenced-twig
11841187
- include: fenced-verilog
1188+
- include: fenced-wast
1189+
- include: fenced-wit
11851190
- include: fenced-xonsh
11861191

11871192
fenced-actionscript:
@@ -2858,6 +2863,50 @@ contexts:
28582863
1: punctuation.definition.raw.code-fence.end.markdown
28592864
2: meta.fold.code-fence.end.markdown
28602865
2866+
fenced-wast:
2867+
- match: |-
2868+
(?x)
2869+
{{fenced_code_block_start}}
2870+
(?i:\s*(wast))
2871+
{{fenced_code_block_trailing_infostring_characters}}
2872+
captures:
2873+
0: meta.code-fence.definition.begin.wast.markdown-gfm
2874+
2: punctuation.definition.raw.code-fence.begin.markdown
2875+
5: constant.other.language-name.markdown
2876+
6: comment.line.infostring.markdown
2877+
7: meta.fold.code-fence.begin.markdown
2878+
embed: scope:source.wast
2879+
embed_scope:
2880+
markup.raw.code-fence.wast.markdown-gfm
2881+
source.wast
2882+
escape: '{{fenced_code_block_escape}}'
2883+
escape_captures:
2884+
0: meta.code-fence.definition.end.wast.markdown-gfm
2885+
1: punctuation.definition.raw.code-fence.end.markdown
2886+
2: meta.fold.code-fence.end.markdown
2887+
2888+
fenced-wit:
2889+
- match: |-
2890+
(?x)
2891+
{{fenced_code_block_start}}
2892+
(?i:\s*(wit))
2893+
{{fenced_code_block_trailing_infostring_characters}}
2894+
captures:
2895+
0: meta.code-fence.definition.begin.wit.markdown-gfm
2896+
2: punctuation.definition.raw.code-fence.begin.markdown
2897+
5: constant.other.language-name.markdown
2898+
6: comment.line.infostring.markdown
2899+
7: meta.fold.code-fence.begin.markdown
2900+
embed: scope:source.wit
2901+
embed_scope:
2902+
markup.raw.code-fence.wit.markdown-gfm
2903+
source.wit
2904+
escape: '{{fenced_code_block_escape}}'
2905+
escape_captures:
2906+
0: meta.code-fence.definition.end.wit.markdown-gfm
2907+
1: punctuation.definition.raw.code-fence.end.markdown
2908+
2: meta.fold.code-fence.end.markdown
2909+
28612910
fenced-xonsh:
28622911
- match: |-
28632912
(?x)

0 commit comments

Comments
 (0)