Color coding commented statements and comments following a statement

68 visualizaciones (últimos 30 días)
PChoppala
PChoppala el 18 de Nov. de 2015
Respondida: mohand alzuhiri el 25 de Oct. de 2022
Hi,
I would like to know if there is a possibility of having a different color for a commented statement and a comment that follows a statement, e.g.,
% u=rand
u = rand % generate a random number from U[0,1]
shows both in green but I would like to differentiate. I could not find a lead from MATLAB preferences.
  9 comentarios
olshie
olshie el 28 de Feb. de 2022
It would be great to differentiate comment colors with flags: for example
%todo: do this later
would appear in a different color.
Gionata Quadri
Gionata Quadri el 13 de Mayo de 2022
A small workaround could be to write the "comments" (e.g. todo) as a system command with the bash colon operator ':', and temporarily change their color in the settings.
s = settings;
s.matlab.colors.SystemCommandColor.TemporaryValue = [255 75 0];
!: TODO: Lorem ipsum
Unfortunately it only works on new lines.

Iniciar sesión para comentar.

Respuestas (5)

Michal Demjan
Michal Demjan el 21 de Ag. de 2019
Also interested!
Maybe just implement different commenting function starting with '%!' or something..

mbvoyager
mbvoyager el 24 de Ag. de 2018
I'm also interested in this feature!

Francesco Guaresi
Francesco Guaresi el 4 de Dic. de 2018
Hi guys! I'm interested too!!

Eli
Eli el 7 de Jul. de 2022
I would also like more customizability for organizing code (like changing colors of comments)!

mohand alzuhiri
mohand alzuhiri el 25 de Oct. de 2022
It would be nice to have a special color for ToDo items...This feature would be useful especially when you want to share them with your team

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by