Editor and command windows next to each other, Part 2
Show older comments
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
Jan
on 30 May 2018
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:
Answers (1)
Fangjun Jiang
on 1 Jun 2018
1 vote
You could select the already written comments, right click, and select "Wrap Comments", or Ctrl+J
2 Comments
alpedhuez
on 1 Jun 2018
Jan
on 2 Jun 2018
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.
Categories
Find more on Environment and Settings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!