필터 지우기
필터 지우기

comments line change automatically

조회 수: 40 (최근 30일)
clear all
clear all 2017년 2월 25일
댓글: clear all 2017년 2월 27일
The code I was given has lots of comments without enter. Comment length is over my laptop monitor size so I have to use horizontal scroll bar.
Is there any clever way to line change and re-align comments not to use horizontal scroll bar?
Thank you.

채택된 답변

John D'Errico
John D'Errico 2017년 2월 25일
편집: John D'Errico 2017년 2월 25일
If you look in the editor preferences, you will see that you can force the editor to wrap comments at some column number, that can be set by you. (The default was 75 columns as I recall.)
So I think the best you can do is to simply add a space, to the end of such a run-on comment line. The editor will then automatically wrap the line. If the line was so long that it would wrap to 5 or 10 lines, you will need to add multiple spaces, since adding one space will simply pull off the first 75 characters from that line. The editor will look for spaces to break the line, so it won't break a long word.
So, while this is not a great solution, I think it is your only option. At least you need only do this once, then save the offending file, with now readable comments.
  댓글 수: 1
Image Analyst
Image Analyst 2017년 2월 25일
편집: Image Analyst 2017년 2월 25일
Adding a space will not re-do that line's comments. I just tried it. It only does that for new things you type that go beyond the limits in SetPreferences->Editor/Debugger->Language and/or SetPreferences->Editor/Debugger->Display.
Actually it doesn't even seem to do it for new lines in existing buffers in the editor - it seems to do it only for new scripts that you open.

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

추가 답변 (1개)

Chad Greene
Chad Greene 2017년 2월 25일
Does my wraptext function help?
  댓글 수: 1
clear all
clear all 2017년 2월 27일
Thank you so much. It is awesome tool! Thank you.

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

카테고리

Help CenterFile Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by