Skip to content

Indentation problem with switch statements #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gseerden opened this issue Aug 18, 2016 · 5 comments
Closed

Indentation problem with switch statements #93

gseerden opened this issue Aug 18, 2016 · 5 comments

Comments

@gseerden
Copy link

gseerden commented Aug 18, 2016

Hi,

I have encountered a problem when indenting a ts file with ggVG=. The indentation seems to be broken within switch statements.

let foo = {
    name: 'hello'
};

foo.title = 'Hello';

if (true) {
    let bar = {};
    let correctIndentation = {};
}

switch(foo.name) {
    case 'hello':
        let bar = {};
    let wrongIndentation = {};
    break;
        default:
        break;
}

Thanks a lot for your plugin!

@leafgarland
Copy link
Owner

Thanks for the bug report. I will take a look

@CandySunPlus
Copy link

+1

1 similar comment
@gbrlsnchs
Copy link

+1

@leafgarland
Copy link
Owner

Changes in #107 will format your code snippet like this:

let foo = {
    name: 'hello'
};

foo.title = 'Hello';

if (true) {
    let bar = {};
    let correctIndentation = {};
}

switch(foo.name) {
    case 'hello':
        let bar = {};
        let wrongIndentation = {};
        break;
    default:
        break;
}

If you get chance to test it, that would be great.

@thejohnfreeman
Copy link

I tested it. This issue is fixed. I recommend closing it.

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

No branches or pull requests

5 participants