From 73c92c0364b63533b841d0870a9d833e7357bd18 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sun, 26 Sep 2021 23:08:46 +0200 Subject: [PATCH 01/18] Fix: Restore incremental heading level keybinding on MacOS --- Default (OSX).sublime-keymap | 4 ++-- messages.json | 3 ++- messages/3.0.5.md | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 messages/3.0.5.md diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index 19ad69ae..22659812 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -438,13 +438,13 @@ { "key": "setting.mde.keymap_disable.set_heading_level", "operand": false } ] }, - { "keys": ["ctrl+alt+."], "command": "mde_change_headings_level", "args": {"by": 1}, "context": + { "keys": ["super+alt+."], "command": "mde_change_headings_level", "args": {"by": 1}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "setting.mde.keymap_disable.set_heading_level", "operand": false } ] }, - { "keys": ["ctrl+alt+,"], "command": "mde_change_headings_level", "args": {"by": -1}, "context": + { "keys": ["super+alt+,"], "command": "mde_change_headings_level", "args": {"by": -1}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "setting.mde.keymap_disable.set_heading_level", "operand": false } diff --git a/messages.json b/messages.json index bc6c2755..6f46460c 100644 --- a/messages.json +++ b/messages.json @@ -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" } diff --git a/messages/3.0.5.md b/messages/3.0.5.md new file mode 100644 index 00000000..39693bfc --- /dev/null +++ b/messages/3.0.5.md @@ -0,0 +1,14 @@ +# 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 + +## New Features + +## Changes + +[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues From 9488f65afbceaa6999d4b4c12cf2e8ba7a09a6eb Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sun, 26 Sep 2021 23:27:15 +0200 Subject: [PATCH 02/18] Docs: Fix typo --- docs/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index bfab73fe..bb947178 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -11,7 +11,7 @@ Thus all user specific syntax specific settings or overrides can or must be remo 1. Open a Markdown file 2. Open Command Palette ctrl+shift+p 3. Execute `Preferences: Settings - Syntax Specific` -4. Remove everything judjged useless from the right panel. +4. Remove everything judged useless from the right panel. The following syntax specific settings have been removed: From 02243cbf17d05f2ccc10bc70d797f4efd4850a83 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Mon, 27 Sep 2021 18:11:53 +0200 Subject: [PATCH 03/18] Feature: Add fenced code blocks protobuf highlighting (fixes #650) Requires https://packagecontrol.io/packages/Protobuf%20Syntax%20Hightlighting --- messages/3.0.5.md | 2 ++ syntaxes/Markdown.sublime-syntax | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/messages/3.0.5.md b/messages/3.0.5.md index 39693bfc..09326a8a 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -9,6 +9,8 @@ feedback you can use [GitHub issues][issues]. ## New Features +* Add fenced code blocks protobuf highlighting (fixes #650) + ## Changes [issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 5be236dd..ee1ce085 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -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 @@ -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) From 13c84cb5ce9141f9fc5bef61150f57ef09f6365e Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Mon, 27 Sep 2021 18:13:59 +0200 Subject: [PATCH 04/18] Fix: Add go and dockerfile language identifiers Fixes #650 --- messages/3.0.5.md | 1 + syntaxes/Markdown.sublime-syntax | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/messages/3.0.5.md b/messages/3.0.5.md index 09326a8a..de3e0a01 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -6,6 +6,7 @@ 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) ## New Features diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index ee1ce085..1b08225c 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -1076,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 @@ -1674,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 From 41a1281ef73ff9ef6228dcf8e2f8c0bc18a50941 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Mon, 27 Sep 2021 19:01:11 +0200 Subject: [PATCH 05/18] Change: f12 and shift+f12 to jump between references and definitions This commit binds `mde_jump_reference` and `mde_magic_footnotes` commands to f12 and shift+f12 to if caret is within a reference or its definition. Goal is to create a seamless UX compared with ST's normal Goto Definition/Reference functions. Note: 1. The two mentioned commands may need to be merged into one in a future commit. 2. The old binding ctrl+alt+g is removed. --- Default (Linux).sublime-keymap | 29 ++++++++++++++++++++++------- Default (OSX).sublime-keymap | 29 ++++++++++++++++++++++------- Default (Windows).sublime-keymap | 29 ++++++++++++++++++++++------- docs/usage.md | 2 ++ messages/3.0.5.md | 3 +++ 5 files changed, 71 insertions(+), 21 deletions(-) diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index 61c38152..7f15f5b6 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -1016,13 +1016,6 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - // jump to reference - { "keys": ["ctrl+alt+g"], "command": "mde_reference_jump", "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, - { "key": "setting.mde.keymap_disable.reference_jump", "operator": "not_equal", "operand": true } - ] - }, // organize references { "keys": ["ctrl+alt+s"], "command": "mde_reference_organize", "context": [ @@ -1030,6 +1023,28 @@ { "key": "setting.mde.keymap_disable.reference_organize", "operator": "not_equal", "operand": true } ] }, + // jump to reference + { "keys": ["f12"], "command": "mde_reference_jump", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference string.other.link", "match_all": true } + ] + }, + { "keys": ["shift+f12"], "command": "mde_reference_jump", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.markdown entity.name.reference.link", "match_all": true } + ] + }, + // jump to footnote + { "keys": ["f12"], "command": "mde_magic_footnotes", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.footnote", "match_all": true } + ] + }, + { "keys": ["shift+f12"], "command": "mde_magic_footnotes", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.footnote entity.name.reference.link", "match_all": true } + ] + }, // // CriticMarkup diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index 22659812..a6ab63a4 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -1016,13 +1016,6 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - // jump to reference - { "keys": ["super+ctrl+shift+l"], "command": "mde_reference_jump", "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, - { "key": "setting.mde.keymap_disable.reference_jump", "operator": "not_equal", "operand": true } - ] - }, // organize references { "keys": ["super+ctrl+s"], "command": "mde_reference_organize", "context": [ @@ -1030,6 +1023,28 @@ { "key": "setting.mde.keymap_disable.reference_organize", "operator": "not_equal", "operand": true } ] }, + // jump to reference + { "keys": ["f12"], "command": "mde_reference_jump", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference string.other.link", "match_all": true } + ] + }, + { "keys": ["shift+f12"], "command": "mde_reference_jump", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.markdown entity.name.reference.link", "match_all": true } + ] + }, + // jump to footnote + { "keys": ["f12"], "command": "mde_magic_footnotes", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.footnote", "match_all": true } + ] + }, + { "keys": ["shift+f12"], "command": "mde_magic_footnotes", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.footnote entity.name.reference.link", "match_all": true } + ] + }, // // CriticMarkup diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index 61c38152..7f15f5b6 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -1016,13 +1016,6 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - // jump to reference - { "keys": ["ctrl+alt+g"], "command": "mde_reference_jump", "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, - { "key": "setting.mde.keymap_disable.reference_jump", "operator": "not_equal", "operand": true } - ] - }, // organize references { "keys": ["ctrl+alt+s"], "command": "mde_reference_organize", "context": [ @@ -1030,6 +1023,28 @@ { "key": "setting.mde.keymap_disable.reference_organize", "operator": "not_equal", "operand": true } ] }, + // jump to reference + { "keys": ["f12"], "command": "mde_reference_jump", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference string.other.link", "match_all": true } + ] + }, + { "keys": ["shift+f12"], "command": "mde_reference_jump", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.markdown entity.name.reference.link", "match_all": true } + ] + }, + // jump to footnote + { "keys": ["f12"], "command": "mde_magic_footnotes", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.footnote", "match_all": true } + ] + }, + { "keys": ["shift+f12"], "command": "mde_magic_footnotes", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference.def.footnote entity.name.reference.link", "match_all": true } + ] + }, // // CriticMarkup diff --git a/docs/usage.md b/docs/usage.md index e517d46d..08973358 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -269,6 +269,8 @@ Important functions are bound to following keys by default: | Ctrl + Alt + R | + + R | Creates or pastes the contents of the clipboard as a reference link. | Shift + Win + K | + + K | Creates or pastes the contents of the clipboard as an inline image on selected text. | Alt + Shift + 6 | + + 6 | Inserts a footnote. +| f12 | f12 | Jump to reference/footnote definition. +| shift+f12 | shift+f12 | Jump from definition to reference(s). # Critic Markup diff --git a/messages/3.0.5.md b/messages/3.0.5.md index de3e0a01..290aa1a6 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -11,7 +11,10 @@ feedback you can use [GitHub issues][issues]. ## New Features * Add fenced code blocks protobuf highlighting (fixes #650) +* Bind f12 and shift+f12 to jump between references and definitions ## Changes +* The ctrl+alt+g is no longer bound by default in favor of f12 + [issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues From 64f30dfcb0047e83fc00730930a7d2cabcc68645 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 10:46:14 +0200 Subject: [PATCH 06/18] Change: Replace `Convert to Blockquote` macro by `mde_indent_quote` This commit reduces implementation fragmentation of block quote related functions as the mix of macros vs. plugins is hard to maintain. --- Default (Linux).sublime-keymap | 24 +++++++++++----------- Default (OSX).sublime-keymap | 24 +++++++++++----------- Default (Windows).sublime-keymap | 24 +++++++++++----------- macros/Convert to Blockquote.sublime-macro | 6 ------ messages/3.0.5.md | 1 + 5 files changed, 37 insertions(+), 42 deletions(-) delete mode 100644 macros/Convert to Blockquote.sublime-macro diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index 7f15f5b6..21df386e 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -891,13 +891,6 @@ // Quotes // - // Convert to blockquote - { "keys": [">"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Convert to Blockquote.sublime-macro"}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, - { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } - ] - }, // Extend blockquote (ignore headings, lists and tasks) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": [ @@ -937,17 +930,24 @@ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true } ] }, - // Indent blockquote + // Convert to or increase block quote level (selected text) + { "keys": [">"], "command": "mde_indent_quote", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } + ] + }, + // Increase block quote level { "keys": ["ctrl+shift+."], "command": "mde_indent_quote", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true } ] }, - // Unindent blockquote + // Decrease block quote level { "keys": ["ctrl+shift+,"], "command": "mde_unindent_quote", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "(> )+", "match_all": true } + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(> )+", "match_all": true } ] }, diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index a6ab63a4..2ec984ab 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -891,13 +891,6 @@ // Quotes // - // Convert to blockquote - { "keys": [">"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Convert to Blockquote.sublime-macro"}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, - { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } - ] - }, // Extend blockquote (ignore headings, lists and tasks) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": [ @@ -937,17 +930,24 @@ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true } ] }, - // Indent blockquote + // Convert to or increase block quote level (selected text) + { "keys": [">"], "command": "mde_indent_quote", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } + ] + }, + // Increase block quote level { "keys": ["super+shift+."], "command": "mde_indent_quote", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true } ] }, - // Unindent blockquote + // Decrease block quote level { "keys": ["super+shift+,"], "command": "mde_unindent_quote", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "(> )+", "match_all": true } + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(> )+", "match_all": true } ] }, diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index 7f15f5b6..21df386e 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -891,13 +891,6 @@ // Quotes // - // Convert to blockquote - { "keys": [">"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Convert to Blockquote.sublime-macro"}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, - { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } - ] - }, // Extend blockquote (ignore headings, lists and tasks) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": [ @@ -937,17 +930,24 @@ { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true } ] }, - // Indent blockquote + // Convert to or increase block quote level (selected text) + { "keys": [">"], "command": "mde_indent_quote", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } + ] + }, + // Increase block quote level { "keys": ["ctrl+shift+."], "command": "mde_indent_quote", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true } ] }, - // Unindent blockquote + // Decrease block quote level { "keys": ["ctrl+shift+,"], "command": "mde_unindent_quote", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "(> )+", "match_all": true } + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(> )+", "match_all": true } ] }, diff --git a/macros/Convert to Blockquote.sublime-macro b/macros/Convert to Blockquote.sublime-macro deleted file mode 100644 index 9544bd77..00000000 --- a/macros/Convert to Blockquote.sublime-macro +++ /dev/null @@ -1,6 +0,0 @@ -[ - {"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"}} -] diff --git a/messages/3.0.5.md b/messages/3.0.5.md index 290aa1a6..f37c6bff 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -15,6 +15,7 @@ feedback you can use [GitHub issues][issues]. ## Changes +* The `>` key is bound to `mde_indent_quote` to replace `Convert to Blockquote` macro * The ctrl+alt+g is no longer bound by default in favor of f12 [issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues From fefbc7cc3e482efbd5561bcdc26f12575546cbd0 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 11:07:31 +0200 Subject: [PATCH 07/18] Fix: Hitting backspace removes only one block quote sign (fixes #651) --- Default (Linux).sublime-keymap | 12 ++++++++++-- Default (OSX).sublime-keymap | 12 ++++++++++-- Default (Windows).sublime-keymap | 12 ++++++++++-- macros/Delete Empty Blockquote.sublime-macro | 5 +++++ macros/Delete Left 2.sublime-macro | 4 ++++ messages/3.0.5.md | 1 + 6 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 macros/Delete Empty Blockquote.sublime-macro create mode 100644 macros/Delete Left 2.sublime-macro diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index 21df386e..5bd7043c 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -923,10 +923,18 @@ // { "key": "setting.auto_complete_commit_on_tab" } // ] // }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context": + // Decrease block quote level + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left 2.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s$", "match_all": true } + ] + }, + // Decrease block quote level and trim whitespace after caret + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty Blockquote.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, - { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)*(>\\s?)$", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s?$", "match_all": true }, { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true } ] }, diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index 2ec984ab..f98dec48 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -923,10 +923,18 @@ // { "key": "setting.auto_complete_commit_on_tab" } // ] // }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context": + // Decrease block quote level + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left 2.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s$", "match_all": true } + ] + }, + // Decrease block quote level and trim whitespace after caret + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty Blockquote.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, - { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)*(>\\s?)$", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s?$", "match_all": true }, { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true } ] }, diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index 21df386e..5bd7043c 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -923,10 +923,18 @@ // { "key": "setting.auto_complete_commit_on_tab" } // ] // }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context": + // Decrease block quote level + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left 2.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s$", "match_all": true } + ] + }, + // Decrease block quote level and trim whitespace after caret + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty Blockquote.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, - { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)*(>\\s?)$", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s?$", "match_all": true }, { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true } ] }, diff --git a/macros/Delete Empty Blockquote.sublime-macro b/macros/Delete Empty Blockquote.sublime-macro new file mode 100644 index 00000000..5716827a --- /dev/null +++ b/macros/Delete Empty Blockquote.sublime-macro @@ -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/}"}} +] diff --git a/macros/Delete Left 2.sublime-macro b/macros/Delete Left 2.sublime-macro new file mode 100644 index 00000000..8174ef9b --- /dev/null +++ b/macros/Delete Left 2.sublime-macro @@ -0,0 +1,4 @@ +[ + {"command": "left_delete" }, + {"command": "left_delete" } +] diff --git a/messages/3.0.5.md b/messages/3.0.5.md index f37c6bff..f9845b24 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -7,6 +7,7 @@ feedback you can use [GitHub issues][issues]. * 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) ## New Features From ed06541bf140f10a75b886734ee8b5938f2cd712 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 12:27:42 +0200 Subject: [PATCH 08/18] Feature: Terminate blockquote via ctrl+enter This commit adds two newlines and optionally removes quote signs of trailing empty quotation line. --- Default (Linux).sublime-keymap | 43 +++++++++++-------- Default (OSX).sublime-keymap | 43 +++++++++++-------- Default (Windows).sublime-keymap | 43 +++++++++++-------- ...Remove Empty Blockquote Line.sublime-macro | 5 --- .../Terminate Empty Blockquote.sublime-macro | 5 +++ messages/3.0.5.md | 1 + 6 files changed, 84 insertions(+), 56 deletions(-) delete mode 100644 macros/Remove Empty Blockquote Line.sublime-macro create mode 100644 macros/Terminate Empty Blockquote.sublime-macro diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index 5bd7043c..1417c26d 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -906,23 +906,32 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - // Remove empty blockquote line - // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context": - // [ - // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, - // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true }, - // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, - // { "key": "auto_complete_visible", "operator": "equal", "operand": false } - // ] - // }, - // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context": - // [ - // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, - // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true }, - // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, - // { "key": "setting.auto_complete_commit_on_tab" } - // ] - // }, + // Terminate blockquote + { "keys": ["ctrl+enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true } + ] + }, + { "keys": ["ctrl+keypad_enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true } + ] + }, + // Terminate empty blockquote + { "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + ] + }, + { "keys": ["ctrl+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + ] + }, // Decrease block quote level { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left 2.sublime-macro"}, "context": [ diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index f98dec48..53ee45e8 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -906,23 +906,32 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - // Remove empty blockquote line - // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context": - // [ - // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, - // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true }, - // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, - // { "key": "auto_complete_visible", "operator": "equal", "operand": false } - // ] - // }, - // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context": - // [ - // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, - // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true }, - // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, - // { "key": "setting.auto_complete_commit_on_tab" } - // ] - // }, + // Terminate blockquote + { "keys": ["super+enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true } + ] + }, + { "keys": ["super+keypad_enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true } + ] + }, + // Terminate empty blockquote + { "keys": ["super+enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + ] + }, + { "keys": ["super+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + ] + }, // Decrease block quote level { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left 2.sublime-macro"}, "context": [ diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index 5bd7043c..1417c26d 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -906,23 +906,32 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - // Remove empty blockquote line - // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context": - // [ - // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, - // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true }, - // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, - // { "key": "auto_complete_visible", "operator": "equal", "operand": false } - // ] - // }, - // { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty Blockquote Line.sublime-macro"}, "context": - // [ - // { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, - // { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*(>\\s*)+$", "match_all": true }, - // { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, - // { "key": "setting.auto_complete_commit_on_tab" } - // ] - // }, + // Terminate blockquote + { "keys": ["ctrl+enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true } + ] + }, + { "keys": ["ctrl+keypad_enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true } + ] + }, + // Terminate empty blockquote + { "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + ] + }, + { "keys": ["ctrl+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Terminate Empty Blockquote.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*>\\s*(?:[-+*](?:\\s+\\[[ xX]\\])?|\\d+[.)])\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + ] + }, // Decrease block quote level { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left 2.sublime-macro"}, "context": [ diff --git a/macros/Remove Empty Blockquote Line.sublime-macro b/macros/Remove Empty Blockquote Line.sublime-macro deleted file mode 100644 index 9e727ffb..00000000 --- a/macros/Remove Empty Blockquote Line.sublime-macro +++ /dev/null @@ -1,5 +0,0 @@ -[ - {"command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}}, - {"command": "insert", "args": {"characters": "\n"}}, - {"command": "move", "args": {"by": "characters", "forward": false}} -] diff --git a/macros/Terminate Empty Blockquote.sublime-macro b/macros/Terminate Empty Blockquote.sublime-macro new file mode 100644 index 00000000..ad1f5180 --- /dev/null +++ b/macros/Terminate Empty Blockquote.sublime-macro @@ -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/}"}} +] diff --git a/messages/3.0.5.md b/messages/3.0.5.md index f9845b24..522d136f 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -13,6 +13,7 @@ feedback you can use [GitHub issues][issues]. * Add fenced code blocks protobuf highlighting (fixes #650) * Bind f12 and shift+f12 to jump between references and definitions +* Block quotes can be terminated via ctrl+enter ## Changes From 29fdba2f1351a2c099c6ae055148672de72fff61 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 14:32:57 +0200 Subject: [PATCH 09/18] Fix: Add missing keypad_enter bindings --- Default (Linux).sublime-keymap | 162 +++++++++++++++++++++++++++++++ Default (OSX).sublime-keymap | 162 +++++++++++++++++++++++++++++++ Default (Windows).sublime-keymap | 162 +++++++++++++++++++++++++++++++ messages/3.0.5.md | 1 + 4 files changed, 487 insertions(+) diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index 1417c26d..ed4f20b0 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -490,6 +490,16 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -500,6 +510,16 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -510,6 +530,16 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -520,6 +550,16 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, { "keys": ["tab"], "command": "mde_complete_underlined_headings", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -706,6 +746,12 @@ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } ] }, + { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } + ] + }, // Extend lists (also in block quotes) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": [ @@ -714,6 +760,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -721,6 +774,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Extend lists with GFM tasks (also in block quotes) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": [ @@ -729,6 +789,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -736,6 +803,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Extend Numbered Lists (also in block quotes) { "keys": ["enter"], "command": "mde_number_list", "context": [ @@ -744,6 +818,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "mde_number_list", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "mde_number_list", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -751,6 +832,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "mde_number_list", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Remove empty list item including GFM tasks { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": [ @@ -760,6 +848,14 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -768,6 +864,14 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -899,6 +1003,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, @@ -906,6 +1017,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Terminate blockquote { "keys": ["ctrl+enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context": [ @@ -1025,6 +1143,13 @@ { "key": "auto_complete_visible", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true }, + { "key": "auto_complete_visible", "operand": false } + ] + }, // extend numbered reference if auto-completions are commited via tab only { "keys": ["enter"], "command": "mde_add_numbered_reference_definition", "context": [ @@ -1033,6 +1158,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // organize references { "keys": ["ctrl+alt+s"], "command": "mde_reference_organize", "context": [ @@ -1080,6 +1212,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Addition.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.addition", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, // discard addition { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Addition.sublime-macro"}, "context": [ @@ -1107,6 +1245,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true }, @@ -1135,6 +1279,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Deletion.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.deletion", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, // discard deletion { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Deletion.sublime-macro"}, "context": [ @@ -1164,6 +1314,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true }, @@ -1192,6 +1348,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Substitution.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.substitution", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, // discard substitution { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Substitution.sublime-macro"}, "context": [ diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index 53ee45e8..6d01819f 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -490,6 +490,16 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -500,6 +510,16 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -510,6 +530,16 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -520,6 +550,16 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, { "keys": ["tab"], "command": "mde_complete_underlined_headings", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -706,6 +746,12 @@ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } ] }, + { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } + ] + }, // Extend lists (also in block quotes) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": [ @@ -714,6 +760,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -721,6 +774,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Extend lists with GFM tasks (also in block quotes) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": [ @@ -729,6 +789,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -736,6 +803,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Extend Numbered Lists (also in block quotes) { "keys": ["enter"], "command": "mde_number_list", "context": [ @@ -744,6 +818,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "mde_number_list", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "mde_number_list", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -751,6 +832,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "mde_number_list", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Remove empty list item including GFM tasks { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": [ @@ -760,6 +848,14 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -768,6 +864,14 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -899,6 +1003,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, @@ -906,6 +1017,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Terminate blockquote { "keys": ["super+enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context": [ @@ -1025,6 +1143,13 @@ { "key": "auto_complete_visible", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true }, + { "key": "auto_complete_visible", "operand": false } + ] + }, // extend numbered reference if auto-completions are commited via tab only { "keys": ["enter"], "command": "mde_add_numbered_reference_definition", "context": [ @@ -1033,6 +1158,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // organize references { "keys": ["super+ctrl+s"], "command": "mde_reference_organize", "context": [ @@ -1080,6 +1212,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Addition.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.addition", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, // discard addition { "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Addition.sublime-macro"}, "context": [ @@ -1107,6 +1245,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, { "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true }, @@ -1135,6 +1279,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Deletion.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.deletion", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, // discard deletion { "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Deletion.sublime-macro"}, "context": [ @@ -1164,6 +1314,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, { "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true }, @@ -1192,6 +1348,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["super+alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Substitution.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.substitution", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, // discard substitution { "keys": ["super+alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Substitution.sublime-macro"}, "context": [ diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index 1417c26d..ed4f20b0 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -490,6 +490,16 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -500,6 +510,16 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -510,6 +530,16 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -520,6 +550,16 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, + { "key": "setting.mde.match_heading_hashes", "operator": "equal", "operand": false }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*#+\\s+", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, { "keys": ["tab"], "command": "mde_complete_underlined_headings", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, @@ -706,6 +746,12 @@ { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } ] }, + { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } + ] + }, // Extend lists (also in block quotes) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": [ @@ -714,6 +760,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -721,6 +774,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Extend lists with GFM tasks (also in block quotes) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": [ @@ -729,6 +789,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -736,6 +803,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)\\[[ xX]\\](\\s+)).*/\n$1$2$3[ ]$4/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^([\\s>]*([-+*])\\s+)\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Extend Numbered Lists (also in block quotes) { "keys": ["enter"], "command": "mde_number_list", "context": [ @@ -744,6 +818,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "mde_number_list", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "mde_number_list", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -751,6 +832,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "mde_number_list", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*\\d+[.)]", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Remove empty list item including GFM tasks { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": [ @@ -760,6 +848,14 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -768,6 +864,14 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, + { "key": "following_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, @@ -899,6 +1003,13 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, + { "key": "auto_complete_visible", "operator": "equal", "operand": false } + ] + }, { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, @@ -906,6 +1017,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // Terminate blockquote { "keys": ["ctrl+enter"], "command": "insert_snippet", "args": {"contents": "\n\n"}, "context": [ @@ -1025,6 +1143,13 @@ { "key": "auto_complete_visible", "operand": false } ] }, + { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true }, + { "key": "auto_complete_visible", "operand": false } + ] + }, // extend numbered reference if auto-completions are commited via tab only { "keys": ["enter"], "command": "mde_add_numbered_reference_definition", "context": [ @@ -1033,6 +1158,13 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, + { "keys": ["keypad_enter"], "command": "mde_add_numbered_reference_definition", "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\[.*\\d+\\]:", "match_all": true }, + { "key": "setting.auto_complete_commit_on_tab" } + ] + }, // organize references { "keys": ["ctrl+alt+s"], "command": "mde_reference_organize", "context": [ @@ -1080,6 +1212,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Addition.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.addition", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, // discard addition { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Addition.sublime-macro"}, "context": [ @@ -1107,6 +1245,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Comment.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.comment", "match_all": true }, @@ -1135,6 +1279,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Deletion.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.deletion", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, // discard deletion { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Deletion.sublime-macro"}, "context": [ @@ -1164,6 +1314,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Highlight.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.highlight", "match_all": true }, @@ -1192,6 +1348,12 @@ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } ] }, + { "keys": ["alt+keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Commit Critic Substitution.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.critic.substitution", "match_all": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false } + ] + }, // discard substitution { "keys": ["alt+backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Discard Critic Substitution.sublime-macro"}, "context": [ diff --git a/messages/3.0.5.md b/messages/3.0.5.md index 522d136f..b62e2984 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -8,6 +8,7 @@ feedback you can use [GitHub issues][issues]. * 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 keypad_enter bindings ## New Features From 0e33b35e68f4360057819811aba13e98c45ea507 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 14:49:56 +0200 Subject: [PATCH 10/18] Docs: Add some usage comments about block quotes --- docs/usage.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/usage.md b/docs/usage.md index 08973358..09ee5e9e 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -205,6 +205,24 @@ Navigation is bound to following keys by default: | Ctrl + Shift + PageUp/PageDown | + + PageUp/PageDown | Go to the previous/next heading of any level | Ctrl + Alt + Shift + PageUp/PageDown | + + PageUp/PageDown | 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 >. +2. By hitting Enter a new empty block quote line is added. +3. By hitting Del at the end of a block quote line, + the following line is merged by removing its leading quotes. +4. Quoted text can be indented (tab) and unindent (shift + tab) as it wasn't quoted. + +Further available key bindings: + +| Linux/Windows | MacOS | Description +|---------------|-------|------------- +| Ctrl + Shift + . | + + . | Increase block quote level (add one more `> `) +| Ctrl + Shift + , | + + , | Decrease block quote level (remove a `> `) +| Ctrl + Enter | + Enterkbd> | Terminate block quote by adding two newline's.
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`. From 1c1e278ed9e1afb18c230b87515284dc5ec7019b Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 14:52:05 +0200 Subject: [PATCH 11/18] Docs: Uppercase key modifiers --- docs/usage.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 09ee5e9e..47916dfc 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -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 tab after `-` or `=` and underline width is adjusted to headings text length. +Just hit Tab after `-` or `=` and underline width is adjusted to headings text length. ![headings-setext](img/headings-setext.png) @@ -107,10 +107,10 @@ or use one of the following bindings: | Linux/Windows | MacOS | Description |---------------|-------|------------- -| alt + k, alt + 0 | ^ + k, ^ + 0 | convert headings into normal text -| alt + k, alt + 1..6 | ^ + k, ^ + 1..6 | set headings level to 1..6 -| ctrl + alt + , | + ^ + , | reduce headings level by one -| ctrl + alt + . | + ^ + . | increase headings level by one +| Alt + k, Alt + 0 | ^ + k, ^ + 0 | convert headings into normal text +| Alt + k, Alt + 1..6 | ^ + k, ^ + 1..6 | set headings level to 1..6 +| Ctrl + Alt + , | + ^ + , | reduce headings level by one +| Ctrl + Alt + . | + ^ + . | increase headings level by one Key bindings can be disabled via `"mde.keymap_disable.set_heading_level": true`. @@ -155,9 +155,9 @@ Folding is bound to following keys by default: | Linux/Windows | MacOS | Description |---------------|-------|------------- -| ctrl + k, ctrl + 0 | + k, + 0 | Unfold all sections -| ctrl + k, ctrl + 1..6 | + k, + 1..6 | Fold sections by level 1..6 -| ctrl + k, ctrl + 9 | + k, + 9 | Fold all sections, but keep headings of any level visible +| Ctrl + k, Ctrl + 0 | + k, + 0 | Unfold all sections +| Ctrl + k, Ctrl + 1..6 | + k, + 1..6 | Fold sections by level 1..6 +| Ctrl + k, Ctrl + 9 | + k, + 9 | Fold all sections, but keep headings of any level visible | Shift + Tab | + Tab | Fold/Unfold current section. | Ctrl + Shift + Tab | ^ + + Tab | Fold all sections under headings of a certain level. @@ -213,7 +213,7 @@ MarkdownEditing cretes a natural natural editing experience of block quotes. 2. By hitting Enter a new empty block quote line is added. 3. By hitting Del at the end of a block quote line, the following line is merged by removing its leading quotes. -4. Quoted text can be indented (tab) and unindent (shift + tab) as it wasn't quoted. +4. Quoted text can be indented (Tab) and unindent (Shift + Tab) as it wasn't quoted. Further available key bindings: @@ -287,8 +287,8 @@ Important functions are bound to following keys by default: | Ctrl + Alt + R | + + R | Creates or pastes the contents of the clipboard as a reference link. | Shift + Win + K | + + K | Creates or pastes the contents of the clipboard as an inline image on selected text. | Alt + Shift + 6 | + + 6 | Inserts a footnote. -| f12 | f12 | Jump to reference/footnote definition. -| shift+f12 | shift+f12 | Jump from definition to reference(s). +| F12 | F12 | Jump to reference/footnote definition. +| Shift+F12 | Shift+F12 | Jump from definition to reference(s). # Critic Markup From c6c63e63701de548935795ff4ae1b08baf1b38ba Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 15:07:08 +0200 Subject: [PATCH 12/18] Change: Improve and rename Delete Empty List Item macro This commit ... 1. renames `Remove Empty List Item` macro to `Delete Empty List Item` 2. improves the macro's implementation --- Default (Linux).sublime-keymap | 10 +++++----- Default (OSX).sublime-keymap | 10 +++++----- Default (Windows).sublime-keymap | 10 +++++----- macros/Delete Empty List Item.sublime-macro | 5 +++++ macros/Remove Empty List Item.sublime-macro | 7 ------- messages/3.0.5.md | 1 + 6 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 macros/Delete Empty List Item.sublime-macro delete mode 100644 macros/Remove Empty List Item.sublime-macro diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index ed4f20b0..b8860cd1 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -840,7 +840,7 @@ ] }, // Remove empty list item including GFM tasks - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -848,7 +848,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -856,7 +856,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -864,7 +864,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -872,7 +872,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s?$", "match_all": true }, diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index 6d01819f..a671988a 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -840,7 +840,7 @@ ] }, // Remove empty list item including GFM tasks - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -848,7 +848,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -856,7 +856,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -864,7 +864,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -872,7 +872,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s?$", "match_all": true }, diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index ed4f20b0..b8860cd1 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -840,7 +840,7 @@ ] }, // Remove empty list item including GFM tasks - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -848,7 +848,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -856,7 +856,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -864,7 +864,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s*$", "match_all": true }, @@ -872,7 +872,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Empty List Item.sublime-macro"}, "context": + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Empty List Item.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*([-+*]|\\d+[.)])(?:\\s+\\[[ xX]\\])?\\s?$", "match_all": true }, diff --git a/macros/Delete Empty List Item.sublime-macro b/macros/Delete Empty List Item.sublime-macro new file mode 100644 index 00000000..6fad501f --- /dev/null +++ b/macros/Delete Empty List Item.sublime-macro @@ -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/}"}} +] diff --git a/macros/Remove Empty List Item.sublime-macro b/macros/Remove Empty List Item.sublime-macro deleted file mode 100644 index b387cd2d..00000000 --- a/macros/Remove Empty List Item.sublime-macro +++ /dev/null @@ -1,7 +0,0 @@ -[ - {"command": "move_to", "args": {"to": "eol", "extend": false}}, - {"command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*).*/\n$1/}"}}, - {"command": "move", "args": {"by": "lines", "forward": false}}, - {"command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}}, - {"command": "move_to", "args": {"to": "eol", "extend": false}} -] diff --git a/messages/3.0.5.md b/messages/3.0.5.md index b62e2984..140492fa 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -20,5 +20,6 @@ feedback you can use [GitHub issues][issues]. * The `>` key is bound to `mde_indent_quote` to replace `Convert to Blockquote` macro * The ctrl+alt+g is no longer bound by default in favor of f12 +* The `Remove Empty List Item` macro is renamed to `Delete Empty List Item` [issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues From 145c222dbb9830d55768b1e60861a374d2f41f68 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 16:44:12 +0200 Subject: [PATCH 13/18] Fix: Auto-complete setext heading underlines only if caret is at eol --- Default (Linux).sublime-keymap | 1 + Default (OSX).sublime-keymap | 1 + Default (Windows).sublime-keymap | 1 + messages/3.0.5.md | 1 + 4 files changed, 4 insertions(+) diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index b8860cd1..7998969f 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -565,6 +565,7 @@ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\-+$|^\\=+$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true } ] }, diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index a671988a..d16aeb9d 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -565,6 +565,7 @@ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\-+$|^\\=+$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true } ] }, diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index b8860cd1..7998969f 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -565,6 +565,7 @@ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\-+$|^\\=+$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true } ] }, diff --git a/messages/3.0.5.md b/messages/3.0.5.md index 140492fa..c99ccdca 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -9,6 +9,7 @@ feedback you can use [GitHub issues][issues]. * Fenced codeblocks learned `go` and `dockerfile` language identifiers (fixes #650) * Hitting backspace removes only one block quote sign (fixes #651) * Add misssing keypad_enter bindings +* Auto-complete setext heading underlines only if caret is at eol ## New Features From e51aceff5b975f6afbf2ec32bd20b095d477117a Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 16:59:34 +0200 Subject: [PATCH 14/18] Fix: Hitting tab key after single `-` or `*` inserts `\t` This commit prevents `tab` key from invoking `mde_indent_list` if 1. caret is directly after `-` or `*` and no other non-whitespace characters follow. 2. caret is located within - thematic breaks (`meta.separator`) or - setext heading underlines (`markup.heading`) --- Default (Linux).sublime-keymap | 7 +++---- Default (OSX).sublime-keymap | 7 +++---- Default (Windows).sublime-keymap | 7 +++---- messages/3.0.5.md | 1 + 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index 7998969f..8e135c1c 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -908,7 +908,7 @@ // Hitting "tab" directly after new list bullet should insert \t otherwise { "keys": ["tab"], "command": "mde_indent_list_item", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "has_next_field", "operator": "equal", "operand": false }, { "key": "overlay_visible", "operator": "equal", "operand": false }, @@ -919,12 +919,11 @@ // Indent list item if caret is behind bullets { "keys": ["tab"], "command": "mde_indent_list_item", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "has_next_field", "operator": "equal", "operand": false }, { "key": "overlay_visible", "operator": "equal", "operand": false }, - { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s*$", "match_all": true }, - { "key": "following_text", "operator": "not_regex_match", "operand": "(?:-{2,}|={2,}|[+*])", "match_all": true } + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s+$", "match_all": true } ] }, // Indent selected list items diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index d16aeb9d..7f6193f6 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -908,7 +908,7 @@ // Hitting "tab" directly after new list bullet should insert \t otherwise { "keys": ["tab"], "command": "mde_indent_list_item", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "has_next_field", "operator": "equal", "operand": false }, { "key": "overlay_visible", "operator": "equal", "operand": false }, @@ -919,12 +919,11 @@ // Indent list item if caret is behind bullets { "keys": ["tab"], "command": "mde_indent_list_item", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "has_next_field", "operator": "equal", "operand": false }, { "key": "overlay_visible", "operator": "equal", "operand": false }, - { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s*$", "match_all": true }, - { "key": "following_text", "operator": "not_regex_match", "operand": "(?:-{2,}|={2,}|[+*])", "match_all": true } + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s+$", "match_all": true } ] }, // Indent selected list items diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index 7998969f..8e135c1c 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -908,7 +908,7 @@ // Hitting "tab" directly after new list bullet should insert \t otherwise { "keys": ["tab"], "command": "mde_indent_list_item", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "has_next_field", "operator": "equal", "operand": false }, { "key": "overlay_visible", "operator": "equal", "operand": false }, @@ -919,12 +919,11 @@ // Indent list item if caret is behind bullets { "keys": ["tab"], "command": "mde_indent_list_item", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw", "match_all": true }, + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.heading - meta.separator", "match_all": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "has_next_field", "operator": "equal", "operand": false }, { "key": "overlay_visible", "operator": "equal", "operand": false }, - { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s*$", "match_all": true }, - { "key": "following_text", "operator": "not_regex_match", "operand": "(?:-{2,}|={2,}|[+*])", "match_all": true } + { "key": "preceding_text", "operator": "regex_match", "operand": "^[\\s>]*[-+*]\\s+$", "match_all": true } ] }, // Indent selected list items diff --git a/messages/3.0.5.md b/messages/3.0.5.md index c99ccdca..ff280c6b 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -10,6 +10,7 @@ feedback you can use [GitHub issues][issues]. * Hitting backspace removes only one block quote sign (fixes #651) * Add misssing keypad_enter bindings * Auto-complete setext heading underlines only if caret is at eol +* Fix regression with tab after single `-` or `*` not inserting `\t` ## New Features From adebc933d7e517be0b4eb47a35a523b5a0939e4b Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 17:51:10 +0200 Subject: [PATCH 15/18] Change: Rename and improve Trailing Hashes macros This commit ... - renames the `Remove Trailing Hashes` macro to `Add Newline and Delete Trailing Hashes` - renames the `Remove Empty List Item` macro to `Delete Empty List Item` - improves macro implementation by reducing care movements etc. --- Default (Linux).sublime-keymap | 16 ++++++++-------- Default (OSX).sublime-keymap | 16 ++++++++-------- Default (Windows).sublime-keymap | 16 ++++++++-------- ...ine and Balance Trailing Hashes.sublime-macro | 5 +++++ ...Line and Delete Trailing Hashes.sublime-macro | 5 +++++ macros/Balance Trailing Hashes.sublime-macro | 9 --------- macros/Remove Trailing Hashes.sublime-macro | 9 --------- messages/3.0.5.md | 2 ++ 8 files changed, 36 insertions(+), 42 deletions(-) create mode 100644 macros/Add Line and Balance Trailing Hashes.sublime-macro create mode 100644 macros/Add Line and Delete Trailing Hashes.sublime-macro delete mode 100644 macros/Balance Trailing Hashes.sublime-macro delete mode 100644 macros/Remove Trailing Hashes.sublime-macro diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index 8e135c1c..80e13945 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -480,7 +480,7 @@ { "key": "following_text", "operator": "regex_contains", "operand": "^#+\\s\\S", "match_all": true } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -490,7 +490,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -500,7 +500,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -510,7 +510,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -520,7 +520,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -530,7 +530,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -540,7 +540,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -550,7 +550,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index 7f6193f6..836d0e6a 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -480,7 +480,7 @@ { "key": "following_text", "operator": "regex_contains", "operand": "^#+\\s\\S", "match_all": true } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -490,7 +490,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -500,7 +500,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -510,7 +510,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -520,7 +520,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -530,7 +530,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -540,7 +540,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -550,7 +550,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index 8e135c1c..80e13945 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -480,7 +480,7 @@ { "key": "following_text", "operator": "regex_contains", "operand": "^#+\\s\\S", "match_all": true } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -490,7 +490,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -500,7 +500,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -510,7 +510,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Balance Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Balance Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -520,7 +520,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -530,7 +530,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -540,7 +540,7 @@ { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, @@ -550,7 +550,7 @@ { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Remove Trailing Hashes.sublime-macro"}, "context": + { "keys": ["keypad_enter"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Add Line and Delete Trailing Hashes.sublime-macro"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, { "key": "setting.mde.auto_match_heading_hashes", "operator": "equal", "operand": true }, diff --git a/macros/Add Line and Balance Trailing Hashes.sublime-macro b/macros/Add Line and Balance Trailing Hashes.sublime-macro new file mode 100644 index 00000000..ab26c765 --- /dev/null +++ b/macros/Add Line and Balance Trailing Hashes.sublime-macro @@ -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 $2\n$1/}"}} +] diff --git a/macros/Add Line and Delete Trailing Hashes.sublime-macro b/macros/Add Line and Delete Trailing Hashes.sublime-macro new file mode 100644 index 00000000..1c5d58bd --- /dev/null +++ b/macros/Add Line and Delete Trailing Hashes.sublime-macro @@ -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/}"}} +] diff --git a/macros/Balance Trailing Hashes.sublime-macro b/macros/Balance Trailing Hashes.sublime-macro deleted file mode 100644 index a23bdd6c..00000000 --- a/macros/Balance Trailing Hashes.sublime-macro +++ /dev/null @@ -1,9 +0,0 @@ -[ - {"command": "move_to", "args": {"to": "eol", "extend": false}}, - {"command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)(#+)(.*?)\\s*#*\\s*$/\n$1$2$3 $2\n$1/}"}}, - {"command": "move", "args": {"by": "lines", "forward": false}}, - {"command": "move", "args": {"by": "lines", "forward": false}}, - {"command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}}, - {"command": "move", "args": {"by": "lines", "forward": true}}, - {"command": "move_to", "args": {"to": "eol", "extend": false}} -] diff --git a/macros/Remove Trailing Hashes.sublime-macro b/macros/Remove Trailing Hashes.sublime-macro deleted file mode 100644 index 73edc998..00000000 --- a/macros/Remove Trailing Hashes.sublime-macro +++ /dev/null @@ -1,9 +0,0 @@ -[ - {"command": "move_to", "args": {"to": "eol", "extend": false}}, - {"command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)(#+)(.*?)\\s*#*\\s*$/\n$1$2$3\n$1/}"}}, - {"command": "move", "args": {"by": "lines", "forward": false}}, - {"command": "move", "args": {"by": "lines", "forward": false}}, - {"command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}}, - {"command": "move", "args": {"by": "lines", "forward": true}}, - {"command": "move_to", "args": {"to": "eol", "extend": false}} -] diff --git a/messages/3.0.5.md b/messages/3.0.5.md index ff280c6b..d8d01cb2 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -22,6 +22,8 @@ feedback you can use [GitHub issues][issues]. * The `>` key is bound to `mde_indent_quote` to replace `Convert to Blockquote` macro * The ctrl+alt+g is no longer bound by default in favor of f12 +* 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 From 5b58615318dab3b5c929ae3b00191882903d19d4 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 18:19:02 +0200 Subject: [PATCH 16/18] Fix: Correctly indent 2nd line of GFM task --- Default (Linux).sublime-keymap | 17 +++++++++++++++-- Default (OSX).sublime-keymap | 17 +++++++++++++++-- Default (Windows).sublime-keymap | 17 +++++++++++++++-- messages/3.0.5.md | 1 + 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index 80e13945..b6d2a993 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -741,18 +741,31 @@ ] }, // Add line to current list item - { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context": + { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } ] }, - { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context": + { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } ] }, + // Add line to current GFM task + { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true } + ] + }, + { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true } + ] + }, // Extend lists (also in block quotes) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": [ diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index 836d0e6a..c319eaaf 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -741,18 +741,31 @@ ] }, // Add line to current list item - { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context": + { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } ] }, - { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context": + { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } ] }, + // Add line to current GFM task + { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true } + ] + }, + { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true } + ] + }, // Extend lists (also in block quotes) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": [ diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index 80e13945..b6d2a993 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -741,18 +741,31 @@ ] }, // Add line to current list item - { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context": + { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } ] }, - { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1 $3/}"}, "context": + { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*](?:\\s+\\S|\\s*$)", "match_all": true } ] }, + // Add line to current GFM task + { "keys": ["shift+enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true } + ] + }, + { "keys": ["shift+keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*)([-+*])(\\s+).*/\n$1 $3/}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - markup.raw", "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "^[\\s>]*[-+*][ ]\\[[ xX]\\](?:\\s+\\S|\\s*$)", "match_all": true } + ] + }, // Extend lists (also in block quotes) { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^(?:\\s*((?:>\\s*)*)([-+*])(\\s+)).*/\n$1$2$3/}"}, "context": [ diff --git a/messages/3.0.5.md b/messages/3.0.5.md index d8d01cb2..e325c727 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -11,6 +11,7 @@ feedback you can use [GitHub issues][issues]. * Add misssing keypad_enter bindings * Auto-complete setext heading underlines only if caret is at eol * Fix regression with tab after single `-` or `*` not inserting `\t` +* shift+enter correctly indents 2nd line of GFM task ## New Features From 7f057121a240f65728f3588993ad557f34f86fa5 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 2 Oct 2021 18:34:05 +0200 Subject: [PATCH 17/18] Fix: Maintain indentation of block quote content when adding new line --- Default (Linux).sublime-keymap | 8 ++++---- Default (OSX).sublime-keymap | 8 ++++---- Default (Windows).sublime-keymap | 8 ++++---- messages/3.0.5.md | 1 + 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index b6d2a993..a11e4d49 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -1009,28 +1009,28 @@ // // Extend blockquote (ignore headings, lists and tasks) - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index c319eaaf..a833ed5a 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -1009,28 +1009,28 @@ // // Extend blockquote (ignore headings, lists and tasks) - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index b6d2a993..a11e4d49 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -1009,28 +1009,28 @@ // // Extend blockquote (ignore headings, lists and tasks) - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, { "key": "setting.auto_complete_commit_on_tab" } ] }, - { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)*(?:>\\s?)).*/\n$1/}"}, "context": + { "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "${TM_CURRENT_LINE/^\\s*((?:>\\s*)+).*/\n$1/}"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown markup.quote", "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:>\\s*)+(?![-+*>#\\s]|\\d+[.)])", "match_all": true }, diff --git a/messages/3.0.5.md b/messages/3.0.5.md index e325c727..f9fabbf2 100644 --- a/messages/3.0.5.md +++ b/messages/3.0.5.md @@ -12,6 +12,7 @@ feedback you can use [GitHub issues][issues]. * Auto-complete setext heading underlines only if caret is at eol * Fix regression with tab after single `-` or `*` not inserting `\t` * shift+enter correctly indents 2nd line of GFM task +* Maintain indentation of block quote content when adding new line ## New Features From d48892695741677c21c1543217108082fe783351 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sun, 3 Oct 2021 13:36:53 +0200 Subject: [PATCH 18/18] Docs: Update troubleshooting --- docs/troubleshooting.md | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index bb947178..bacaa6e4 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -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 ctrl+shift+p 3. Execute `Preferences: Settings - Syntax Specific` -4. Remove everything judged 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,