Automatic Comment Wrapping and Wrap Comment command

조회 수: 17 (최근 30일)
Nick
Nick 2014년 2월 11일
댓글: Image Analyst 2016년 4월 13일
When adding a comment at the end of a line of code, R2012b will not automatically wrap the comment when it reaches the "maximum column width" setting in preferences. It works fine for a line that is all comment.
The "wrap comment" command also does not work on the comment after a bit of actual code.
Am I expecting too much?
  댓글 수: 2
Richard Downey
Richard Downey 2016년 4월 13일
Nobody has an answer for this?
Image Analyst
Image Analyst 2016년 4월 13일
Probably because no one is using R2012b anymore. We've all upgraded by now.

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

답변 (1개)

Image Analyst
Image Analyst 2014년 2월 11일
That's because it's like you said - it's for comments. At least under R2013a it's under Editor/Debugger->Language->Comment formatting. If you want code, look at the Editor/Debugger->Display->right hand text limit. What is that set for for you? How does it differ from the number for the comment formatting? Are they different or the same number?
  댓글 수: 1
Nick
Nick 2014년 2월 11일
편집: Nick 2014년 2월 11일
Thanks. I am using R2012b. Under Language, maximum column width is set to 75 and "Start from the beginning of line" for comment formatting. Setting "Wrap comments automatically while typing" is checked. Under Display, the right-hand text limit is set to 75 columns. Not really anything else to set there. The issue is the first part of the line sets a variable followed by a too long comment on the same line, e.g.
timevar1 = 20.0; %This comment is going to run past 75 columns
But that comment won't get wrapped at 75 either automatically or when I try to use the button for wrap in the ribbon. Does this feature not work for line that has both code and comment in it?

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

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by