LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   syntax highlighting (https://www.linuxquestions.org/questions/programming-9/syntax-highlighting-340141/)

rohr 07-05-2005 04:05 AM

syntax highlighting
 
hello, i have the following question:
in my MATLAB code i have a lot of "for...end" or "if....end" and most of them are nested one inside the other, do you know how to recognise whose "for" or "if" an "end" belongs to?
i know some editors are able to do this (vim, emacs, kwite...)

thank you!

bigearsbilly 07-05-2005 07:22 AM

if you have such high levels of nesting,
maybe you should split the code into more functions.

enemorales 07-06-2005 05:37 AM

IIRC, matlab comes with an editor that does syntax highlighting...

Maybe you can look for tools for octave highlighting also, because it is very similar to matlab...

dr_zayus69 07-06-2005 06:07 AM

i don't know anything about MATLAB(is it an editor?) but i use emacs. Emacs does highlighting by default but you shouldn't stop using something you know to use an editor you may not have experience with. It is a good idea to pick an editor and learn it in and out. If you absolutely need syntax highlighting to make the code more clearer i'd think of refactoring your code. Imagine the people that may at some point look at your code that wouldn't have access to syntax highlight (like viewing it shitastic notepad) or if the person is colorblind. good luck with any route you take.


All times are GMT -5. The time now is 02:04 PM.