How can I make matlab editor wrap long comments?

60 ビュー (過去 30 日間)
Eric von Bloedau
Eric von Bloedau 2017 年 6 月 4 日
編集済み: per isakson 2017 年 6 月 6 日
In Preferences > Editor/Debugger > Display > Right-hand text limit , the placement setting is set to 75 columns. When I type long comments, the comments do not wrap. Please indicate possible methods to achieve comment wrapping in Matlab.

回答 (2 件)

per isakson
per isakson 2017 年 6 月 5 日
編集済み: per isakson 2017 年 6 月 6 日
It works for me on R2016a. The wrapping of comment lines are controlled by
Preferences > Editor/Debugger > Language > Comment formatting > Maximum column width
and
Preferences > Editor/Debugger > Language > Wrap comments automatically while typing.
That is the Language submenu not the Display submenu!
&nbsp
The Editor does not wrap comments with:
* Code section titles (comments that begin with %%)
* Long contiguous text, such as URLs
* Bulleted list items (text that begins with * or #) onto the preceding line.
In the following cases comments are not wrapped (undocumented?)
  • Comment at the end of a line of code
  • Comment after an ellipsis (...)
  • When typing text "inside" of a comment. (Wrapping works only when typing at the very end of the line.)
  • When pasting text to a comment
In these cases I use Cntrl+J (Wrap comments).

Guillaume
Guillaume 2017 年 6 月 5 日
Below the setting you mention, there's a setting Wrap comments automatically while typing. Have you checked that box?

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by