Auto indent feature in the could editor

I teach high school students programming using Arduinos and the auto indent feature of the new web editor has never worked. It is so helpful for teaching and learning to have it embedded. Anyone know when it is expected to work? I would use the IDE, but the kids are on Chromebooks.

I just tried the web editor, and it does auto-indent. Maybe it's caused by the Chromebook?

void setup() {
  pinMode(IN1, OUTPUT);  //Sets the pin as an OUTPUT
  pinMode(IN2, OUTPUT);  //Sets the pin as an OUTPUT
      pinMode(IN3, OUTPUT);  //Sets the pin as an OUTPUT
  pinMode(IN4, OUTPUT);  //Sets the pin as an OUTPUT
  pinMode(limitPin, INPUT_PULLUP);  //
  Serial.begin(9600);
  if(IN1 == 3){
Serial.print("Three");
        }
else{
                  Serial.print("Not Three");
}
}

I just used the auto indents button on the code above and nothing happened. I am not using a chromebook. What am I doing wrong???

The editor does automatically indent when you press enter, but it also has an auto indent button on the right side of the editor that used to correct indenting mistakes. I used to use it with students to help them find missing elements like "}" and to help them see the organization of their code.

No button is needed or used, when you enter something like an if true clause the cursor is automatically placed indented between the braces.

  if (a==b) {
    _    
  }

Please do a screen grab of that 'auto indent button', my 2.x IDE has nothing on the right side. Screen grab follows (I do have the Print and Print preview icons via an add on)

Hi @mrhaza. The non-functional "Indent" button bug has been reported to the Arduino Cloud developers. However, I don't have any information to share regarding when they might be able to fix the bug.

You aren't doing anything at all wrong. The button simply has no effect due to a bug in Arduino Cloud Editor.

The "Indent" button is intended to be the equivalent of Arduino IDE's Sketch > Auto Format feature. Surely you have been around here long enough to know that an auto-format capability is absolutely needed. No matter how much automagical formatting the editor does for the user while they are typing, any new user (and even most experienced users) are going to end up with incorrectly formatted code as they develop a sketch.

We see evidence of that every day here on the forum when people post code they wrote in Arduino IDE (which also indents your lines as you write). In cases where the incorrectly formatted code is difficult to read or follow, we will often instruct those users to perform an auto format on the code they posted. But due to the bug in Arduino Cloud Editor, such an instruction is pointless when supporting Arduino Cloud users.

Thanks, that is what I figured. It would really help the kids learn to have that button up and running again. Is there anything I can do to help elevate the importance of fixing this issue?

The auto indent button is the one on the bottom.

I am 100% in agreement; my wording was faulty.

I misunderstood your question. I have since learned there is a bug.

You can submit a ticket to Arduino's technical support system via this form:

https://www.arduino.cc/en/contact-us

As I said in my previous reply, the bug is already being formally tracked by the developers, but a ticket might help to increase the priority of the work to resolve the bug.