Sublime Forum

Prevent auto unfolding in Markdown

#1

Hi everyone. This is a bit of a puzzle.

I am working on ST4 with the Smart Markdown and MarkdownEditing plugins. When I’m working on a Markdown file, I like to collapse all of the sections of the document except for the one that I am currently editing. Unfortunately, I am seeing the folded sections expand automatically when my cursor passes them.

Here’s is what I am seeing:

  1. Open a file with lots of headings
  2. Fold all will collapse all, showing just the top-level headings with arrows to unfold
  3. If I press an arrow key, it will expand everything.

Desired behavior: expand only on-demand using a special keybinding (e.g., shift+tab).

I have another laptop with the desired behavior but I can’t figure out where the settings would be. I thought it was part of Smart Markdown but that doesn’t seem to be it. Could this be buried in a different package somewhere, perhaps?

0 Likes

#2

Does disabling SmartMarkdown or MarkdownEditing change the behavior?

MardownEditing auto-folds and unfolds reference urls, but those shouldn’t affect sections.

IIRC, (most of) SmartMarkdown’s functionality is available in MarkdownEditing as well. Maybe with little bit different key bindings to more closely follow ST defaults.

You can also call sublime.log_commands(True) in ST’s console and then check, which commands are called when moving caret over folded headings. Maybe it helps identifying the root cause.

0 Likes