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 commentaires

Jan
Jan le 30 Mai 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.
Stephen23
Stephen23 le 30 Mai 2018
Modifié(e) : Stephen23 le 30 Mai 2018
"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:

Connectez-vous pour commenter.

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 1 Juin 2018

1 vote

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

2 commentaires

Select all -> Ctrl+J does not work.
Jan
Jan le 2 Juin 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Environment and Settings dans Centre d'aide et File Exchange

Produits

Tags

Question posée :

le 29 Mai 2018

Commenté :

Jan
le 2 Juin 2018

Community Treasure Hunt

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

Start Hunting!

Translated by