Editor and command windows next to each other, Part 2

Now I have two windows side by side. But the comments are not wrapped. I tried "editor/debugger->language->wrap comments automatically while typing" but it does not seem to apply to the existing comments. Please advise steps to have already written comments wrapped.

2 Comments

Of course "wrap while typing" does not concern existing comments, this is the meaning of "while typing". I do not know a ready solution for reformatting comments of existing code. But it might be possible by using the java robot to retype the text character by character. Another idea is to import the file to a cell string, search for the comments and rearrange lines longer than the wanted number of character. But then it matters, if you want to rewrap all comments, or just the lines, which contain comments only.
"Please advise steps to have already written comments wrapped."
None of the MATLAB editors I have used support wrapping all text like that. Perhaps the new ones do? In any case, you can request this feature:

Sign in to comment.

Answers (1)

You could select the already written comments, right click, and select "Wrap Comments", or Ctrl+J

2 Comments

Select all -> Ctrl+J does not work.
Fangjun wrote: "Select the already written comments", not "select all". But under R2016b selecting all and pressing Ctrl-J does re-wrap existing comments successfully. Please post which Matlab version you are using and explain "does not work" with any details. Otherwise the readers cannot understand, which problem you have.

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Tags

Asked:

on 29 May 2018

Commented:

Jan
on 2 Jun 2018

Community Treasure Hunt

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

Start Hunting!