Skip to content

Commit

Permalink
fix folding with code block
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhao28 committed Jul 11, 2017
1 parent 22ef751 commit 35ef993
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion folding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions messages/2.2.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

1 comment on commit 35ef993

@felixhao28
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix #447

Please sign in to comment.