From 0791cb68ce3838266589b1b2c98621bf0511497a Mon Sep 17 00:00:00 2001 From: deathaxe Date: Wed, 23 Nov 2022 21:10:04 +0100 Subject: [PATCH 1/2] Syntax: Fix ST3 compatibility `pop: 1` is not supported by ST3 --- syntaxes/Markdown.sublime-syntax | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index a75892a3..f9eb9cab 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -2446,7 +2446,7 @@ contexts: scope: punctuation.definition.attributes.begin.markdown set: link-def-attr-body - match: ^(?!\s*{)|(?=\S) - pop: 1 + pop: true link-def-attr-body: - meta_scope: meta.attributes.markdown @@ -2460,13 +2460,13 @@ contexts: - expect-attr-or-eol - link-title - match: (?=\{) - pop: 1 + pop: true - match: \S.+ scope: invalid.illegal.expected-eol.markdown expect-attr-or-eol: - match: (?=\{) - pop: 1 + pop: true - include: expect-eol link-def-url: @@ -3339,7 +3339,7 @@ contexts: autolink-inet-group: - match: \) - pop: 1 + pop: true - match: (?=(?:{{html_entity}})*[?!.,:;*_~'"]*[\s<]) pop: true - include: autolink-inet-common From 0b18708c55a59729104b02e179b5423cd0efe80f Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sun, 30 Oct 2022 17:23:48 +0100 Subject: [PATCH 2/2] Plugins: Modify heading style only before saving Fixes #710 --- plugins/headings/style.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/headings/style.py b/plugins/headings/style.py index 72b94761..32eb0fb2 100644 --- a/plugins/headings/style.py +++ b/plugins/headings/style.py @@ -66,6 +66,8 @@ def on_load(self): def on_pre_save(self): self.auto_detect_heading_style() + if self.view.settings().get("mde.auto_match_heading_hashes", False): + self.view.run_command("mde_match_heading_hashes") def auto_detect_heading_style(self): view = self.view @@ -86,6 +88,3 @@ def auto_detect_heading_style(self): view.settings().set("mde.match_heading_hashes", num_trailing / num_leading > 0.5) else: view.settings().erase("mde.match_heading_hashes") - - if view.settings().get("mde.auto_match_heading_hashes", False): - view.run_command("mde_match_heading_hashes")