Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Auto-Indent is misaligning JavaScript Switch statements #49

Closed
ChrisPearce opened this issue Aug 7, 2014 · 11 comments
Closed

Auto-Indent is misaligning JavaScript Switch statements #49

ChrisPearce opened this issue Aug 7, 2014 · 11 comments

Comments

@ChrisPearce
Copy link

The switch statement in JavaScript files is not being indented correctly.

Each case statement is aligning under the break statement directly above it, rather than aligning with the preceding case statement.

A screenshot of this is:
javascript switch statement identing issue

@rmzelle
Copy link

rmzelle commented Aug 8, 2014

Hear, hear.

@Gp2mv3
Copy link

Gp2mv3 commented Oct 19, 2014

I also noticed two different behaviours:
Here the else block is not well indented.

        if(error)
          {
            alert ("Error detected");
          }
          else
            {
              alert("ok");
            }

But also the for block causes a missindentation:

        if(error)
          {
            for(var i = 0; i < 5; i++)
              {
                alert("error");
              }
            }
            else
              {
                alert("ok");
              }

@ghost
Copy link

ghost commented Nov 3, 2014

👍 on @Gp2mv3's comment. I came here to report the same indentation issue with JavaScript.

@framerate
Copy link

This is killing me. No response from anyone involved in the project yet?

@rmzelle
Copy link

rmzelle commented Dec 9, 2014

In the meantime, I've had much better luck with Atom Beautify.

@Gp2mv3
Copy link

Gp2mv3 commented Jan 11, 2015

I think work has been done on this issue because now the indentation is much slower than before... My CPU hit 100% for 5/10 seconds each time I auto-indent, even with smal files (around 300 lines).

@kurtommy
Copy link

any solution for this indentation problem?

@tdbs
Copy link

tdbs commented Apr 14, 2015

For a while i thought it was my fault, amazed this is still a bug since August.

@kurtommy
Copy link

Incredible!

Tommaso Rossi

Contacts:
Skype: kurtommyk
Mobile: 3393000359

Website:
www.rossitommaso.it

Short CV:

  • Linkedin: http://goo.gl/YaokpB
  • Hibryd App: Ionicframework
  • FE: Angular js | Grunt | Bower | Jasmine | Karma | Protractor | HTML5 | CSS3
  • BE: Laravel 5 | cakephp | Symfony | Yii

Rispetta l’ambiente. Hai davvero bisogno di stampare questa mail?
Please consider the environment – Do you really need to print this email?

Informativa Privacy - Ai sensi del D. Lgs n. 196/2003 (Codice Privacy) si precisa che le informazioni contenute in questo messaggio sono riservate e ad uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.

Privacy Information - This message, for the D. Lgs n. 196/2003 (Privacy Code), may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.

Il giorno 14/apr/2015, alle ore 17:59, Tiago Silva notifications@github.com ha scritto:

For a while i thought it was my fault, amazed this is still a bug since August.


Reply to this email directly or view it on GitHub #49 (comment).

@maxbrunsfeld
Copy link
Contributor

Sorry this was open for so long, everyone. See the commit message above for an explanation of the new behavior.

@iddan
Copy link

iddan commented Nov 6, 2016

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants