Effacer les filtres
Effacer les filtres

Grey horizontal line in editor

66 vues (au cours des 30 derniers jours)
matthew schwarz
matthew schwarz le 25 Déc 2022
Commenté : matthew schwarz le 26 Déc 2022
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!

Réponses (2)

DGM
DGM le 25 Déc 2022
Modifié(e) : DGM le 25 Déc 2022
%% 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 commentaires
DGM
DGM le 25 Déc 2022
Modifié(e) : DGM le 25 Déc 2022
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 le 26 Déc 2022
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.

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 25 Déc 2022
Modifié(e) : Image Analyst le 25 Déc 2022
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 commentaires
matthew schwarz
matthew schwarz le 25 Déc 2022
Yep! That's what i've found. It's quite annoying!
Image Analyst
Image Analyst le 25 Déc 2022
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 %.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Entering Commands dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by