Changing this setting to “cpp” would already help a lot I think and is a simple solution. Then most of the code published in this forum would look good and also consistent, even without having to explicitly specify the language first. With the “auto”-setting every block of code might be formatted different.
If you want I can create a feature request to discuss it with some other people too.
Of course if you were to add “overpass” or “ql” to the list, some script with formatting instructions would have to be created, so this would be a much more difficult solution. And then again people would have to know about the possibility to even use this.
Example overpass-query formatted with 'cpp'
// Find all bridges and tunnels that have an inner node connected to another way that is not a bridge or tunnel.
// By Shaun das Schaf
[timeout:600];
{{geocodeArea:"Freiburg"}}->.searchArea;
// BRIDGES
way[highway][bridge=yes](area.searchArea); // Select all bridges
foreach ->.b
{
node(w.b)->.n;
if (n.count(nodes) > 2) // Only process bridges with at least one inner node
{
(.n; - node(w.b:1,-1);); // Select inner nodes
foreach
{
way(bn)[highway][bridge!=yes]->.p; // For each node select the parent ways
if (p.count(ways) >= 1)
{
(.b; .p;); // Output bridge and connected way
out;
>;
out skel;
}
}
}
}
// TUNNELS
way[highway][tunnel=yes](area.searchArea); // Select all tunnels
foreach ->.t
{
node(w.t)->.n;
if (n.count(nodes) > 2) // Only process tunnels with at least one inner node
{
(.n; - node(w.t:1,-1);); // Select inner nodes
foreach
{
way(bn)[highway][tunnel!=yes]->.p; // For each node select the parent ways
if (p.count(ways) >= 1)
{
(.t; .p;); // Output tunnel and connected way
out;
>;
out skel;
}
}
}
}
{{style:
way
{ color:red; fill-color:red; }
way[tunnel=yes]
{ color:green; fill-color:green; }
way[bridge=yes]
{ color:blue; fill-color:blue; }
}}