diff --git a/folding.py b/folding.py index ce637128..42c67797 100644 --- a/folding.py +++ b/folding.py @@ -28,7 +28,8 @@ def all_headings(view): title_end = re.search('(' + m.group() + ')?(\n|$)', text[title_begin:]).start() + title_begin title_begin = m.start() level = m.end() - m.start() - yield (title_begin, title_end, level) + if 'markup.raw.block.markdown' not in view.scope_name(title_begin).split(' '): + yield (title_begin, title_end, level) def get_current_level(view, p): @@ -113,12 +114,14 @@ def run(self, edit, target_level=0): view.show(sublime.Region(0, 0)) sublime.status_message('%d region%s folded' % (n_sections, 's' if n_sections > 1 else '')) + class UnfoldAllSectionsCommand(MDETextCommand): def run(self, edit): view = self.view view.run_command('unfold_all') + class GotoNextHeadingCommand(MDETextCommand): def run(self, edit, same_level=True): diff --git a/messages/2.2.3.md b/messages/2.2.3.md index 360080c2..842ae595 100644 --- a/messages/2.2.3.md +++ b/messages/2.2.3.md @@ -7,6 +7,7 @@ feedback you can use [GitHub issues][issues]. * Link references commands (Jump/Delete/Organize) now work correctly with no-link `[link text]` style and ignore cases. * `[link text]` is now highlighted correctly. +* Folding correctly ignores fake titles in code blocks. ## New Features