Skip to content

Commit

Permalink
Merge branch 'st4-develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Oct 22, 2024
2 parents 1df39dc + e620a3c commit 8bd9216
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 30 deletions.
2 changes: 1 addition & 1 deletion plugins/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class MdeCenteredLineKeeper(MdeViewEventListener):

def on_modified(self):
sel = self.view.sel()
if sel and len(sel) != 1:
if not sel or len(sel) != 1:
return

settings = self.view.settings()
Expand Down
14 changes: 14 additions & 0 deletions syntaxes/Code Block Syntaxes.sublime-completions
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,20 @@
"details": "Specifies <code>SQL</code> code highlighting"
},

// WASM
{
"trigger": "wast",
"annotation": "WAST",
"kind": ["markup", "s", "Syntax"],
"details": "Specifies <code>WebAssembly Text</code> code highlighting"
},
{
"trigger": "wit",
"annotation": "WIT",
"kind": ["markup", "s", "Syntax"],
"details": "Specifies <code>WabAssembly Interface Type</code> code highlighting"
},

// XML
{
"trigger": "atom",
Expand Down
101 changes: 75 additions & 26 deletions syntaxes/Markdown.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -50,55 +50,58 @@ variables:
backticks: |-
(?x:
(`{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
| (`{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
| (`{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
| (`{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
(`{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
| (`{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
| (`{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
| (`{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
)
escapes: \\[-+*/!"#$%&'(),.:;<=>?@\[\\\]^_`{|}~]

balance_square_brackets: |-
(?x:
(?:
(?:{{escapes}})+ # escape characters
| [^\[\]`\\]+(?=[\[\]`\\]|$) # anything that isn't a square bracket or a backtick or the start of an escape character
\\. # maybe escaped character (be lazy)
| [^\[\]`] # anything that isn't a square bracket or backtick
| {{backticks}} # inline code
| \[(?: # nested square brackets (one level deep)
[^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick
{{backticks}}? # balanced backticks
)*\] # closing square bracket
| \[ (?: # nested square brackets (one level deep)
\\. # maybe escaped character (be lazy)
| [^\[\]`] # anything that isn't a square bracket or backtick
| {{backticks}} # inline code
)* \] # closing square bracket
)+
)
balance_square_brackets_and_emphasis: |-
(?x:
(?:
(?:{{escapes}})+ # escape characters
| [^\[\]`\\_*]+(?=[\[\]`\\_*]|$) # anything that isn't a square bracket, a backtick, the start of an escape character, or an emphasis character
\\. # maybe escaped character (be lazy)
| [^\[\]`_*] # anything that isn't a square bracket, backtick or emphasis
| {{backticks}} # inline code
| \[(?: # nested square brackets (one level deep)
[^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick
{{backticks}}? # balanced backticks
)*\] # closing square bracket
| \[ (?: # nested square brackets (one level deep)
\\. # maybe escaped character (be lazy)
| [^\[\]`_*] # anything that isn't a square bracket, backtick or emphasis
| {{backticks}} # inline code
)* \] # closing square bracket
)+ # at least one character
)
balance_square_brackets_pipes_and_emphasis: |-
(?x:
(?:
(?:{{escapes}})+ # escape characters
| [^\[\]`\\_*|]+(?=[\[\]`\\_*|]|$) # anything that isn't a square bracket, a backtick, the start of an escape character, or an emphasis character
\\. # maybe escaped character (be lazy)
| [^\[\]`_*|] # anything that isn't a square bracket, backtick or emphasis or table cell separator
| {{backticks}} # inline code
| \[(?: # nested square brackets (one level deep)
[^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick
{{backticks}}? # balanced backticks
)*\] # closing square bracket
| \[ (?: # nested square brackets (one level deep)
\\. # maybe escaped character (be lazy)
| [^\[\]`_*|] # anything that isn't a square bracket, backtick or emphasis or table cell separator
| {{backticks}} # inline code
)* \] # closing square bracket
)+ # at least one character
)
balanced_emphasis: |-
(?x:
\* (?!\*){{balance_square_brackets_and_emphasis}}+\* (?!\*)
| \*\* {{balance_square_brackets_and_emphasis}}+\*\*
| _ (?!_) {{balance_square_brackets_and_emphasis}}+_ (?!_)
| __ {{balance_square_brackets_and_emphasis}}+__
\* (?!\*){{balance_square_brackets_and_emphasis}}\* (?!\*)
| \*\* {{balance_square_brackets_and_emphasis}}\*\*
| _ (?!_) {{balance_square_brackets_and_emphasis}}_ (?!_)
| __ {{balance_square_brackets_and_emphasis}}__
)
table_cell: |-
Expand Down Expand Up @@ -1182,6 +1185,8 @@ contexts:
- include: fenced-twee
- include: fenced-twig
- include: fenced-verilog
- include: fenced-wast
- include: fenced-wit
- include: fenced-xonsh

fenced-actionscript:
Expand Down Expand Up @@ -2858,6 +2863,50 @@ contexts:
1: punctuation.definition.raw.code-fence.end.markdown
2: meta.fold.code-fence.end.markdown
fenced-wast:
- match: |-
(?x)
{{fenced_code_block_start}}
(?i:\s*(wast))
{{fenced_code_block_trailing_infostring_characters}}
captures:
0: meta.code-fence.definition.begin.wast.markdown-gfm
2: punctuation.definition.raw.code-fence.begin.markdown
5: constant.other.language-name.markdown
6: comment.line.infostring.markdown
7: meta.fold.code-fence.begin.markdown
embed: scope:source.wast
embed_scope:
markup.raw.code-fence.wast.markdown-gfm
source.wast
escape: '{{fenced_code_block_escape}}'
escape_captures:
0: meta.code-fence.definition.end.wast.markdown-gfm
1: punctuation.definition.raw.code-fence.end.markdown
2: meta.fold.code-fence.end.markdown
fenced-wit:
- match: |-
(?x)
{{fenced_code_block_start}}
(?i:\s*(wit))
{{fenced_code_block_trailing_infostring_characters}}
captures:
0: meta.code-fence.definition.begin.wit.markdown-gfm
2: punctuation.definition.raw.code-fence.begin.markdown
5: constant.other.language-name.markdown
6: comment.line.infostring.markdown
7: meta.fold.code-fence.begin.markdown
embed: scope:source.wit
embed_scope:
markup.raw.code-fence.wit.markdown-gfm
source.wit
escape: '{{fenced_code_block_escape}}'
escape_captures:
0: meta.code-fence.definition.end.wit.markdown-gfm
1: punctuation.definition.raw.code-fence.end.markdown
2: meta.fold.code-fence.end.markdown
fenced-xonsh:
- match: |-
(?x)
Expand Down
Loading

0 comments on commit 8bd9216

Please sign in to comment.