How to make section folding have an extra space (empty lines) between sections?
Show older comments
Hello,
in previous MATLAB versions (e.g 2015) you could introduce empty lines to make spaces between sections once they are folded? (so they won't be "sticked" so closed together).
Section was actually defined from %% till the last line of code in it (a=1, in the example below).
In MATLAB 2021b, section defined from %% till the begining of next section. So, when sections are folded, they look too close to each other. If I have many sections, each one with a unique title, once folded, it's a bit difficult to read.
I'm introducing an additional %% line, but it looks very un-natural and a bit weird work-around.
Is there any other solution to that?

THANKS
Accepted Answer
More Answers (1)
Avery
on 21 Feb 2024
2 votes
I second this topic. Being able to include blank lines between sections really helps organize different parts of my code. I would love if blank lines could be preserved in an upcoming revision of the editor.
1 Comment
John
on 16 Jan 2025
Yes I would like a feature to bring back the extra space also. I'm not a super advanced user, but I prefer keeping all my code for a project in one long m file. I'm sure there are a few more of us out there!
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!