You could add the examples somewhere if they are not
covered yet. I don't know if there's much of a
chance to fix that though. Right now the editor is
using the existing C++ indentation which causes the
mismatch. Writing an OpenSCAD specific one is
probably not an easy topic. It certainly would be
nice to have of cause.
I took a quick stab at just moving the keywords from one list to
Indeed, it seemed to change the indentation behavior - in my mind,
for the better. (But I can't claim to have comprehensively tested
It also changed the color of the keywords I moved from green to
It's clear that I don't understand what's really going on, because
(for instance) "module" is also in keywordSet, and it gets a
different indentation behavior. I just took a blind stab, saying "I
want 'for' to behave like 'union' " and so moved it into the same
list. I didn't try to understand the lexer.
diff --git a/src/scadlexer.cpp b/src/scadlexer.cpp
index b5b1a54d..8c9187e6 100644
@@ -6,7 +6,7 @@ ScadLexer::ScadLexer(QObject *parent) : QsciLexerCPP(parent)
// -> Style: Keyword (lexer.l)
- "if else let for each module function true false undef "
+ "let each module function true false undef "
"include use assert";
// -> Style: KeywordSet2 (func.cc)
@@ -24,6 +24,7 @@ ScadLexer::ScadLexer(QObject *parent) : QsciLexerCPP(parent)
// -> Style: GlobalClass
+ "for if else"
"cube sphere cylinder polyhedron square circle polygon text "
"minkowski hull resize child children echo union difference "
"intersection linear_extrude rotate_extrude import group "