Grey horizontal line in editor
76 次查看(过去 30 天)
显示 更早的评论
Hi All,
I changed a battery in the keyboard, there was some button mashing and now I have a thin grey horizontal line where my code can be wrapped i.e. wherever %% occurs, directly above it. It turns blue when I am editing code therein. How do I turn it off? For those tempted to ask, yes i spent a lot of time in the preferences interface looking for the setting. I looked in the forum, someone asked this question and the solution was to turn off code wrapping, I want the wrapping, just not the grey line. (Previous question: https://au.mathworks.com/matlabcentral/answers/245035-how-to-make-comments-not-wrap)
This is not Preferences > editor/debugger/display > "show line"
Thanks!
0 个评论
回答(2 个)
DGM
2022-12-25
编辑:DGM
2022-12-25
%% creates a section break, which is something that can make certain work easier or more modular.
In older versions, this was referred to as "Cell Mode"
8 个评论
DGM
2022-12-25
编辑:DGM
2022-12-25
In R2019b, sections look like this:
As of R2021b, I thought the sections were supposed to look different. There is no longer a yellow fill color, and the section is highlighted only by changing the top and LHS bars to blue. I don't even see a LHS bar in your screenshot, so I don't know if that's messed up or if they just removed that in R2022x.
As far as whether that behavior can be customized/reverted, I don't think so, but I know there's plenty of people who would want it.
See also:
Image Analyst
2022-12-25
编辑:Image Analyst
2022-12-25
The wrapping gray line is a vertical line, not a horizontal line.
See (in r2022b)
Home->Preferences->Editor/Debugger->Display->Right hand text limit->Show Line.
or
Home->Preferences->Editor/Debugger->Language->Comment formatting->Wrap comments automatically while typing.
I don't like autowrapping so I usually set the column really high, like 200 and tell it not to show the line or wrap.
4 个评论
Image Analyst
2022-12-25
I'm not sure why you call that "wrapping." Basically it's an indicator for a section. Sections are blocks of code that can be run as a unit. They are distinguished from adjacent sections by the horizontal lines. The entire section gets run with one click, unlike the normal one-line-at-a-time Step button. There are special Run buttons to the left of the normal Run button on the tool ribbon to deal with different ways to run a section.
If you don't want sections you can get rid of comment lines starting with %%. I don't like to run sections so when I get code from Answers that has %% I just do a global replacement of %% with %.
Not sure if
- you don't want any lines separating your section at all, or
- you just want them all the same color (gray or blue), or
- you want the dividing lines to all be in a certain custom color, or
- you only want lines bordering the particular section you're currently in.
Anyway, for any case, I don't know how to turn the section divider lines off other than to not have sections at all by deleting the double %.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!