필터 지우기
필터 지우기

Grey horizontal line in editor

조회 수: 65 (최근 30일)
matthew schwarz
matthew schwarz 2022년 12월 25일
댓글: matthew schwarz 2022년 12월 26일
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!

답변 (2개)

DGM
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
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:
matthew schwarz
matthew schwarz 2022년 12월 26일
RE Opened old version > no i always do a clean install when updating (i've accidently opened old versions before).
Ok so maybe i just havn't noticed it until now and it is a feture that isn't turn-off able. :/
RE link you posted > i saw that thread thanks.

댓글을 달려면 로그인하십시오.


Image Analyst
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.
If you're seeing a horizontal line then it's probably what @DGM said.
  댓글 수: 4
matthew schwarz
matthew schwarz 2022년 12월 25일
Yep! That's what i've found. It's quite annoying!
Image Analyst
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
  1. you don't want any lines separating your section at all, or
  2. you just want them all the same color (gray or blue), or
  3. you want the dividing lines to all be in a certain custom color, or
  4. 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 CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by