tamzinblake / js3-mode

A chimeric fork of js2-mode and js-mode
GNU General Public License v3.0
181 stars 13 forks source link

Wrong indentation in switch statement. #69

Closed take-cheeze closed 11 years ago

take-cheeze commented 11 years ago

I expected the indentation of switch statement to be like

switch(type) {
case "string":
  string_func();
  break;
case "number":
  number_func();
  break;
case "array":
  array_func();
  break;
}

but in js3-mode I get

switch(type) {
  case "string":
  string_func();
  break;
  case "number":
  number_func();
  break;
  case "array":
  array_func();
  break;
}

Is there way to fix this?

tamzinblake commented 11 years ago

That one always surprises me. Really, there are two issues here - a bug that currently case statement bodies don't get indented, and a feature that case statements can optionally not be indented under switch.

tamzinblake commented 11 years ago

migrated to #70 and #71