Skip to content

Commit

Permalink
Merge branch '3.0.5' into st3176
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Oct 3, 2021
2 parents ad64ec3 + d488926 commit 30f308f
Show file tree
Hide file tree
Showing 18 changed files with 887 additions and 195 deletions.
301 changes: 254 additions & 47 deletions Default (Linux).sublime-keymap

Large diffs are not rendered by default.

305 changes: 256 additions & 49 deletions Default (OSX).sublime-keymap

Large diffs are not rendered by default.

301 changes: 254 additions & 47 deletions Default (Windows).sublime-keymap

Large diffs are not rendered by default.

26 changes: 17 additions & 9 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,44 @@

MarkdownEditing stores settings in _Preferences.sublime-settings_ as of version 3.0.0.

Thus all user specific syntax specific settings or overrides can or must be removed:
The reasons/benefits are:

1. All settings can be set globally, per project, per syntax or per view.
2. It is easier to add syntax specific settings than to override them.
3. ST's distraction free mode already provides a good writer mode out of the box.

This change however requires some manual work to...

1. clean up syntax specific user overrides for those who tried to eliminate
MarkdownEditing's visual changes.
2. restore syntax specific settings for those who want them back.

To clean up or restore syntax specific settings...

1. Open a Markdown file
2. Open Command Palette <kbd>ctrl+shift+p</kbd>
3. Execute `Preferences: Settings - Syntax Specific`
4. Remove everything judjged useless from the right panel.

The following syntax specific settings have been removed:
4. Do required changes to your needs.
a) To clean up, remove no longer needed overrides.
b) To restore, paste desired settings from following code block.

```json
{
"color_scheme": "Packages/MarkdownEditing/MarkdownEditor.tmTheme",

"color_scheme": "MarkdownEditor.sublime-color-scheme",
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": false,
"auto_match_enabled": true,

// Layout
"draw_centered": true,
"word_wrap": true,
"wrap_width": 80,
"rulers": [],

// Line
"line_numbers": false,
"highlight_line": false,
"line_padding_top": 2,
"line_padding_bottom": 2,

// Caret
"caret_style": "wide",
"caret_extra_top": 3,
Expand Down
36 changes: 28 additions & 8 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ In that case you can manually enforce a style via `"mde.match_heading_hashes"` i

MarkdownEditing assists with maintaining width of underlined headings during typing.

Just hit <kbd>tab</kbd> after `-` or `=` and underline width is adjusted to headings text length.
Just hit <kbd>Tab</kbd> after `-` or `=` and underline width is adjusted to headings text length.

![headings-setext](img/headings-setext.png)

Expand Down Expand Up @@ -107,10 +107,10 @@ or use one of the following bindings:

| Linux/Windows | MacOS | Description
|---------------|-------|-------------
| <kbd>alt</kbd> + <kbd>k</kbd>, <kbd>alt</kbd> + <kbd>0</kbd> | <kbd>^</kbd> + <kbd>k</kbd>, <kbd>^</kbd> + <kbd>0</kbd> | convert headings into normal text
| <kbd>alt</kbd> + <kbd>k</kbd>, <kbd>alt</kbd> + <kbd>1..6</kbd> | <kbd>^</kbd> + <kbd>k</kbd>, <kbd>^</kbd> + <kbd>1..6</kbd> | set headings level to 1..6
| <kbd>ctrl</kbd> + <kbd>alt</kbd> + <kbd>,</kbd> | <kbd>⌘</kbd> + <kbd>^</kbd> + <kbd>,</kbd> | reduce headings level by one
| <kbd>ctrl</kbd> + <kbd>alt</kbd> + <kbd>.</kbd> | <kbd>⌘</kbd> + <kbd>^</kbd> + <kbd>.</kbd> | increase headings level by one
| <kbd>Alt</kbd> + <kbd>k</kbd>, <kbd>Alt</kbd> + <kbd>0</kbd> | <kbd>^</kbd> + <kbd>k</kbd>, <kbd>^</kbd> + <kbd>0</kbd> | convert headings into normal text
| <kbd>Alt</kbd> + <kbd>k</kbd>, <kbd>Alt</kbd> + <kbd>1..6</kbd> | <kbd>^</kbd> + <kbd>k</kbd>, <kbd>^</kbd> + <kbd>1..6</kbd> | set headings level to 1..6
| <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>,</kbd> | <kbd>⌘</kbd> + <kbd>^</kbd> + <kbd>,</kbd> | reduce headings level by one
| <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>.</kbd> | <kbd>⌘</kbd> + <kbd>^</kbd> + <kbd>.</kbd> | increase headings level by one

Key bindings can be disabled via `"mde.keymap_disable.set_heading_level": true`.

Expand Down Expand Up @@ -155,9 +155,9 @@ Folding is bound to following keys by default:
| Linux/Windows | MacOS | Description
|---------------|-------|-------------
| <kbd>ctrl</kbd> + <kbd>k</kbd>, <kbd>ctrl</kbd> + <kbd>0</kbd> | <kbd>⌥</kbd> + <kbd>k</kbd>, <kbd>⌥</kbd> + <kbd>0</kbd> | Unfold all sections
| <kbd>ctrl</kbd> + <kbd>k</kbd>, <kbd>ctrl</kbd> + <kbd>1..6</kbd> | <kbd>⌥</kbd> + <kbd>k</kbd>, <kbd>⌥</kbd> + <kbd>1..6</kbd> | Fold sections by level 1..6
| <kbd>ctrl</kbd> + <kbd>k</kbd>, <kbd>ctrl</kbd> + <kbd>9</kbd> | <kbd>⌥</kbd> + <kbd>k</kbd>, <kbd>⌥</kbd> + <kbd>9</kbd> | Fold all sections, but keep headings of any level visible
| <kbd>Ctrl</kbd> + <kbd>k</kbd>, <kbd>Ctrl</kbd> + <kbd>0</kbd> | <kbd>⌥</kbd> + <kbd>k</kbd>, <kbd>⌥</kbd> + <kbd>0</kbd> | Unfold all sections
| <kbd>Ctrl</kbd> + <kbd>k</kbd>, <kbd>Ctrl</kbd> + <kbd>1..6</kbd> | <kbd>⌥</kbd> + <kbd>k</kbd>, <kbd>⌥</kbd> + <kbd>1..6</kbd> | Fold sections by level 1..6
| <kbd>Ctrl</kbd> + <kbd>k</kbd>, <kbd>Ctrl</kbd> + <kbd>9</kbd> | <kbd>⌥</kbd> + <kbd>k</kbd>, <kbd>⌥</kbd> + <kbd>9</kbd> | Fold all sections, but keep headings of any level visible
| <kbd>Shift</kbd> + <kbd>Tab</kbd> | <kbd>⇧</kbd> + <kbd>Tab</kbd> | Fold/Unfold current section.
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Tab</kbd> | <kbd>^</kbd> + <kbd>⇧</kbd> + <kbd>Tab</kbd> | Fold all sections under headings of a certain level.
Expand Down Expand Up @@ -205,6 +205,24 @@ Navigation is bound to following keys by default:
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>PageUp/PageDown</kbd> | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>PageUp/PageDown</kbd> | Go to the previous/next heading of any level
| <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>PageUp/PageDown</kbd> | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>PageUp/PageDown</kbd> | Go to the previous/next heading of the same or higher level

# Block Quotes

MarkdownEditing cretes a natural natural editing experience of block quotes.

1. To convert selected text to a block quote just hit <kbd>></kbd>.
2. By hitting <kbd>Enter</kbd> a new empty block quote line is added.
3. By hitting <kbd>Del</kbd> at the end of a block quote line,
the following line is merged by removing its leading quotes.
4. Quoted text can be indented (<kbd>Tab</kbd>) and unindent (<kbd>Shift</kbd> + <kbd>Tab</kbd>) as it wasn't quoted.

Further available key bindings:

| Linux/Windows | MacOS | Description
|---------------|-------|-------------
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>.</kbd> | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>.</kbd> | Increase block quote level (add one more `> `)
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>,</kbd> | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>,</kbd> | Decrease block quote level (remove a `> `)
| <kbd>Ctrl</kbd> + <kbd>Enter</kbd> | <kbd>⌘</kbd> + <kbd>Enterkbd> | Terminate block quote by adding two newline's.<br/>If the current line is empty, block quote signs are removed.

# Lists and Tasks

List bullets are automatically changed when indenting or unindenting list items by default. This behaviour can be disabled via `"mde.list_indent_auto_switch_bullet": false`.
Expand Down Expand Up @@ -269,6 +287,8 @@ Important functions are bound to following keys by default:
| <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>R</kbd> | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>R</kbd> | Creates or pastes the contents of the clipboard as a reference link.
| <kbd>Shift</kbd> + <kbd>Win</kbd> + <kbd>K</kbd> | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>K</kbd> | Creates or pastes the contents of the clipboard as an inline image on selected text.
| <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>6</kbd> | <kbd>⌥</kbd> + <kbd>⇧</kbd> + <kbd>6</kbd> | Inserts a footnote.
| <kbd>F12</kbd> | <kbd>F12</kbd> | Jump to reference/footnote definition.
| <kbd>Shift+F12</kbd> | <kbd>Shift+F12</kbd> | Jump from definition to reference(s).

# Critic Markup

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[
{"command": "expand_selection", "args": {"to": "line"}},
{"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
{"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^/> /gm}"}},
{"command": "move_to", "args": {"extend": false, "to": "eol"}}
{"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^(\\s*(?:>\\s*)*)(#+)(.*?)\\s*#*\\s*$/$1$2$3 $2\n$1/}"}}
]
5 changes: 5 additions & 0 deletions macros/Add Line and Delete Trailing Hashes.sublime-macro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{"command": "expand_selection", "args": {"to": "line"}},
{"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
{"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^(\\s*(?:>\\s*)*)(#+)(.*?)\\s*#*\\s*$/$1$2$3\n$1/}"}}
]
9 changes: 0 additions & 9 deletions macros/Balance Trailing Hashes.sublime-macro

This file was deleted.

5 changes: 5 additions & 0 deletions macros/Delete Empty Blockquote.sublime-macro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{"command": "expand_selection", "args": {"to": "line"}},
{"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
{"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^([\\s>]*)>.*/$1/}"}}
]
5 changes: 5 additions & 0 deletions macros/Delete Empty List Item.sublime-macro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{"command": "expand_selection", "args": {"to": "line"}},
{"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
{"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^([\\s>]*).*/$1/}"}}
]
4 changes: 4 additions & 0 deletions macros/Delete Left 2.sublime-macro
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{"command": "left_delete" },
{"command": "left_delete" }
]
5 changes: 0 additions & 5 deletions macros/Remove Empty Blockquote Line.sublime-macro

This file was deleted.

7 changes: 0 additions & 7 deletions macros/Remove Empty List Item.sublime-macro

This file was deleted.

9 changes: 0 additions & 9 deletions macros/Remove Trailing Hashes.sublime-macro

This file was deleted.

5 changes: 5 additions & 0 deletions macros/Terminate Empty Blockquote.sublime-macro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{"command": "expand_selection", "args": {"to": "line"}},
{"command": "move", "args": {"by": "characters", "extend": true, "forward": false}},
{"command": "insert_snippet", "args": {"contents": "${TM_SELECTED_TEXT/^(\\s*).*/\n$1/}"}}
]
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
"3.0.1": "messages/3.0.1.md",
"3.0.2": "messages/3.0.2.md",
"3.0.3": "messages/3.0.3.md",
"3.0.4": "messages/3.0.4.md"
"3.0.4": "messages/3.0.4.md",
"3.0.5": "messages/3.0.5.md"
}
31 changes: 31 additions & 0 deletions messages/3.0.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# MarkdownEditing 3.0.5 Changelog

Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
feedback you can use [GitHub issues][issues].

## Bug Fixes

* Restore incremental heading level keybinding on MacOS
* Fenced codeblocks learned `go` and `dockerfile` language identifiers (fixes #650)
* Hitting backspace removes only one block quote sign (fixes #651)
* Add misssing <kbd>keypad_enter</kbd> bindings
* Auto-complete setext heading underlines only if caret is at eol
* Fix regression with <kbd>tab</kbd> after single `-` or `*` not inserting `\t`
* <kbd>shift+enter</kbd> correctly indents 2nd line of GFM task
* Maintain indentation of block quote content when adding new line

## New Features

* Add fenced code blocks protobuf highlighting (fixes #650)
* Bind <kbd>f12</kbd> and <kbd>shift+f12</kbd> to jump between references and definitions
* Block quotes can be terminated via <kbd>ctrl+enter</kbd>

## Changes

* The `>` key is bound to `mde_indent_quote` to replace `Convert to Blockquote` macro
* The <kbd>ctrl+alt+g</kbd> is no longer bound by default in favor of <kbd>f12</kbd>
* The `Balance Trailing Hashes` macro is renamed to `Add Newline and Balance Trailing Hashes`
* The `Remove Trailing Hashes` macro is renamed to `Add Newline and Delete Trailing Hashes`
* The `Remove Empty List Item` macro is renamed to `Delete Empty List Item`

[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues
22 changes: 20 additions & 2 deletions syntaxes/Markdown.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ contexts:
- include: fenced-mermaid
- include: fenced-nim
- include: fenced-powershell
- include: fenced-protobuf
- include: fenced-reason
- include: fenced-sass
- include: fenced-scheme
Expand Down Expand Up @@ -1075,7 +1076,7 @@ contexts:
- match: |-
(?x)
{{fenced_code_block_start}}
((?i:golang))
((?i:go(?:lang)?))
{{fenced_code_block_trailing_infostring_characters}}
captures:
0: meta.code-fence.definition.begin.go.markdown-gfm
Expand Down Expand Up @@ -1673,7 +1674,7 @@ contexts:
- match: |-
(?x)
{{fenced_code_block_start}}
((?i:docker))
((?i:docker(?:file)?))
{{fenced_code_block_trailing_infostring_characters}}
captures:
0: meta.code-fence.definition.begin.docker.markdown-gfm
Expand Down Expand Up @@ -1875,6 +1876,23 @@ contexts:
0: meta.code-fence.definition.end.powershell.markdown-gfm
1: punctuation.definition.raw.code-fence.end.markdown
fenced-protobuf:
- match: |-
(?x)
{{fenced_code_block_start}}
((?i:protobuf))
{{fenced_code_block_trailing_infostring_characters}}
captures:
0: meta.code-fence.definition.begin.protobuf.markdown-gfm
2: punctuation.definition.raw.code-fence.begin.markdown
5: constant.other.language-name.markdown
embed: scope:source.proto
embed_scope: markup.raw.code-fence.protobuf.markdown-gfm
escape: '{{code_fence_escape}}'
escape_captures:
0: meta.code-fence.definition.end.protobuf.markdown-gfm
1: punctuation.definition.raw.code-fence.end.markdown
fenced-reason:
- match: |-
(?x)
Expand Down

0 comments on commit 30f308f

Please sign in to comment.