Skip to content

Commit ddd8822

Browse files
committed
Merge branch 'st4-develop'
2 parents 40b574b + 9819824 commit ddd8822

8 files changed

Lines changed: 72 additions & 14 deletions

File tree

Default (Linux).sublime-keymap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125

126126
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context":
127127
[
128-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
128+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - meta.code-fence - markup.raw - markup.kbd", "match_all": true },
129129
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
130130
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
131131
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\\w`]$", "match_all": true },
@@ -134,21 +134,21 @@
134134
},
135135
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`${0:$SELECTION}`"}, "context":
136136
[
137-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
137+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - meta.code-fence - markup.raw - markup.kbd", "match_all": true },
138138
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
139139
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
140140
]
141141
},
142142
{ "keys": ["`"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
143143
[
144-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
144+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.raw - meta.code-fence - markup.raw.code-fence", "match_all": true },
145145
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
146146
{ "key": "following_text", "operator": "regex_contains", "operand": "^`", "match_all": true }
147147
]
148148
},
149149
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":
150150
[
151-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
151+
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.raw.begin.markdown", "match_all": true },
152152
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
153153
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
154154
{ "key": "preceding_text", "operator": "regex_contains", "operand": "`$", "match_all": true },

Default (OSX).sublime-keymap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125

126126
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context":
127127
[
128-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
128+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - meta.code-fence - markup.raw - markup.kbd", "match_all": true },
129129
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
130130
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
131131
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\\w`]$", "match_all": true },
@@ -134,21 +134,21 @@
134134
},
135135
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`${0:$SELECTION}`"}, "context":
136136
[
137-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
137+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - meta.code-fence - markup.raw - markup.kbd", "match_all": true },
138138
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
139139
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
140140
]
141141
},
142142
{ "keys": ["`"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
143143
[
144-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
144+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.raw - meta.code-fence - markup.raw.code-fence", "match_all": true },
145145
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
146146
{ "key": "following_text", "operator": "regex_contains", "operand": "^`", "match_all": true }
147147
]
148148
},
149149
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":
150150
[
151-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
151+
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.raw.begin.markdown", "match_all": true },
152152
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
153153
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
154154
{ "key": "preceding_text", "operator": "regex_contains", "operand": "`$", "match_all": true },

Default (Windows).sublime-keymap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125

126126
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context":
127127
[
128-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
128+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - meta.code-fence - markup.raw - markup.kbd", "match_all": true },
129129
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
130130
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
131131
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\\w`]$", "match_all": true },
@@ -134,21 +134,21 @@
134134
},
135135
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`${0:$SELECTION}`"}, "context":
136136
[
137-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
137+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - meta.code-fence - markup.raw - markup.kbd", "match_all": true },
138138
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
139139
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
140140
]
141141
},
142142
{ "keys": ["`"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
143143
[
144-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
144+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.raw - meta.code-fence - markup.raw.code-fence", "match_all": true },
145145
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
146146
{ "key": "following_text", "operator": "regex_contains", "operand": "^`", "match_all": true }
147147
]
148148
},
149149
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":
150150
[
151-
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
151+
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.raw.begin.markdown", "match_all": true },
152152
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
153153
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
154154
{ "key": "preceding_text", "operator": "regex_contains", "operand": "`$", "match_all": true },

messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
3939
"3.1.2": "messages/3.1.2.md",
4040
"3.1.3": "messages/3.1.3.md",
4141
"3.1.4": "messages/3.1.4.md",
42-
"3.1.5": "messages/3.1.5.md"
42+
"3.1.5": "messages/3.1.5.md",
43+
"3.1.6": "messages/3.1.6.md"
4344
}

messages/3.1.6.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# MarkdownEditing 3.1.6 Changelog
2+
3+
Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
4+
feedback you can use [GitHub issues][issues].
5+
6+
## Bug Fixes
7+
8+
* Respect `set_unsaved_view_name` setting (#704)
9+
* Fix `markup.raw` auto-pairing key bindings (#707)
10+
* Fix ST freezing due to SETEXT headings with trailing spaces
11+
12+
## New Features
13+
14+
* Add support for Makefile syntax in fenced code blocks
15+
16+
## Changes
17+
18+
[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues

plugins/headings/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class MdeUnsavedViewNameSetter(MdeViewEventListener):
5757
MAX_NAME = 50
5858

5959
def on_modified(self):
60-
if self.view.file_name() is not None:
60+
if self.view.file_name() is not None or not self.view.settings().get("set_unsaved_view_name"):
6161
return
6262

6363
name = first_heading_text(self.view)

syntaxes/Markdown.sublime-syntax

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,12 +918,24 @@ contexts:
918918
- include: setext-heading-content
919919

920920
setext-heading-content:
921+
- include: setext-hard-line-breaks
921922
- include: emphasis
922923
- include: images
923924
- include: literals
924925
- include: links
925926
- include: markups
926927

928+
setext-hard-line-breaks:
929+
# This context consumes what 'hard-line-breaks' does for normal
930+
# paragraphs to avoid deadlock of ST's syntax engine.
931+
#
932+
# as workaround for
933+
# https://github.com/sublimehq/sublime_text/issues/5415
934+
# causing
935+
# https://github.com/sublimehq/Packages/issues/3494
936+
- match: '[ ]{2,}$'
937+
- match: '\\\n'
938+
927939
paragraph:
928940
# https://spec.commonmark.org/0.30/#paragraphs
929941
- meta_scope: meta.paragraph.markdown
@@ -983,6 +995,7 @@ contexts:
983995
- include: fenced-jsx
984996
- include: fenced-lisp
985997
- include: fenced-lua
998+
- include: fenced-makefile
986999
- include: fenced-matlab
9871000
- include: fenced-objc
9881001
- include: fenced-objcpp
@@ -1454,6 +1467,25 @@ contexts:
14541467
0: meta.code-fence.definition.end.lua.markdown-gfm
14551468
1: punctuation.definition.raw.code-fence.end.markdown
14561469
1470+
fenced-makefile:
1471+
- match: |-
1472+
(?x)
1473+
{{fenced_code_block_start}}
1474+
((?i:makefile))
1475+
{{fenced_code_block_trailing_infostring_characters}}
1476+
captures:
1477+
0: meta.code-fence.definition.begin.markdown-gfm
1478+
2: punctuation.definition.raw.code-fence.begin.markdown
1479+
5: constant.other.language-name.markdown
1480+
embed: scope:source.makefile
1481+
embed_scope:
1482+
markup.raw.code-fence.makefile.markdown-gfm
1483+
source.makefile
1484+
escape: '{{fenced_code_block_escape}}'
1485+
escape_captures:
1486+
0: meta.code-fence.definition.end.markdown-gfm
1487+
1: punctuation.definition.raw.code-fence.end.markdown
1488+
14571489
fenced-matlab:
14581490
- match: |-
14591491
(?x)

tests/syntax_test_markdown.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,13 @@ for (var i = 0; i < 10; i++) {
18761876
| <- meta.code-fence.definition.end.lua.markdown-gfm punctuation.definition.raw.code-fence.end.markdown
18771877
|^^ meta.code-fence.definition.end.lua.markdown-gfm punctuation.definition.raw.code-fence.end.markdown
18781878

1879+
```makefile
1880+
1881+
| <- markup.raw.code-fence.makefile.markdown-gfm source.makefile
1882+
```
1883+
| <- meta.code-fence.definition.end.markdown-gfm punctuation.definition.raw.code-fence.end.markdown
1884+
|^^ meta.code-fence.definition.end.markdown-gfm punctuation.definition.raw.code-fence.end.markdown
1885+
18791886
```matlab
18801887
18811888
| <- markup.raw.code-fence.matlab.markdown-gfm source.matlab

0 commit comments

Comments
 (0)