I've found some
inconsistencies with the syntax highlighting of the embedded editor* and they have made me think about readability of code. What should be color differentiated in a code editor? Other than
numbers, strings, and comments... only reserved words? operators?
In the particular case of OpenSCAD, my main problem is nesting. I'm not sure if more colors would help (maybe differentiate transformations from solids? 2D from 3D?).
I don't think I need any more highlighting, I'm pretty much fine with the way
it is. One thing I like, but which few editors allow, is to change the
background of certain lines or elements. Example:
* Module/function definitions. Give the entire line a different background
and they'll stand out in the code.
* Comments. When I comment, I want them the stand out.
* String values and numbers. I like having a grey background on these, so
they stand out as "fields". This is especially useful when concatenating
strings, which can quickly get messy if the strings contains stuff like ",".
However, intellisense would be amazing. I have large utility libraries with
parts and handy functions, and some of these are seldom used and takes many
arguments, and not having to go to the definition each time would be great.
Also, better description of syntax errors and better accuracy in guessing
where things went wrong would be amazing. At the moment, a missed semicolon
or square bracket may list an error two pages away.
SynWrite is a windows-only editor. Its author also created a cross-platform
clone called *CudaText*, which is what I've been using in the past year
(even I am using Windows) and also highly recommended.
Since we wrote the lexer ourselves, it's possible that you can tailor it to
achieve what you want.
Am 12.02.2018 um 14:07 schrieb Troberg:
> I don't think I need any more highlighting, I'm pretty much fine with the way
> it is.
You can always write your own editor color-scheme.
You can select the color-schema via
preferences -> editor -> color syntax highlighting
The path where the color schemas are stored is depending on the
Under windows it should be somewhere like C:\Program
You can simply copy the one you like the most, open it in your favourite
text editor, change the name and start changing things.
Writing your own color schema allows you to give different keywords the
Meaning: Having more keyword-sets allows you a more differentiated
syntax highlighting, without forcing you to a rainbox of colors.
"Write your own color-schema" also applies to those points:
> One thing I like, but which few editors allow, is to change the
> background of certain lines or elements. Example:
> * Module/function definitions. Give the entire line a different background
> and they'll stand out in the code.
> * Comments. When I comment, I want them the stand out.
> * String values and numbers. I like having a grey background on these, so
> they stand out as "fields". This is especially useful when concatenating
> strings, which can quickly get messy if the strings contains stuff like ",".
If you run into limitations while writing your own color schema, you can
off course ask here for help.
If you are very prude of your color scheme, you can ask one of the
maintainers to integrate it into the master branch.