small bug with code formatter (Ctrl-T)

edited July 2017 in Using Processing

If you code-format the sketch below, it pulls the word 'else' up into the comment on the previous line (i.e., it comments-out actual code). Seems to be the {}'s in the comment, which are probably pretty rare.

void setup() {
  size(800, 600);
}

void draw() {
  if (mouseX < width/2)
    ellipse(mouseX, mouseY, 20, 20); // who uses { braces in comments? }
  else
    rect(mouseX, mouseY, 20, 20);
}

Answers

Sign In or Register to comment.