Skip to content

Commit 0b18708

Browse files
author
DeathAxe
committed
Plugins: Modify heading style only before saving
Fixes #710
1 parent 0791cb6 commit 0b18708

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

plugins/headings/style.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ def on_load(self):
6666

6767
def on_pre_save(self):
6868
self.auto_detect_heading_style()
69+
if self.view.settings().get("mde.auto_match_heading_hashes", False):
70+
self.view.run_command("mde_match_heading_hashes")
6971

7072
def auto_detect_heading_style(self):
7173
view = self.view
@@ -86,6 +88,3 @@ def auto_detect_heading_style(self):
8688
view.settings().set("mde.match_heading_hashes", num_trailing / num_leading > 0.5)
8789
else:
8890
view.settings().erase("mde.match_heading_hashes")
89-
90-
if view.settings().get("mde.auto_match_heading_hashes", False):
91-
view.run_command("mde_match_heading_hashes")

0 commit comments

Comments
 (0)