Skip to content
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

[JavaScript] Indentation of for loops fails #3286

Open
deathaxe opened this issue Mar 23, 2022 · 0 comments
Open

[JavaScript] Indentation of for loops fails #3286

deathaxe opened this issue Mar 23, 2022 · 0 comments
Assignees
Labels
C: Indentation Rules T: bug A bug in an existing language feature

Comments

@deathaxe
Copy link
Collaborator

Expected behavior

Example 1

    for (
        let i = 0;
        i < 10;
        i++) {
        let j = 0;
        let k = 0;
    }

Example 2

    for (
        let i = 0;
        i < 10;
        i++
    ) {
        let j = 0;
        let k = 0;
    }

Actual behavior

Indentation fails again, if for loop conditions use multiple lines

Example 1

    for (
        let i = 0;
        i < 10;
        i++) {
        let j = 0;
    let k = 0;
}

Example 2

    for (
        let i = 0;
        i < 10;
        i++
        ) {
        let j = 0;
    let k = 0;
}

Regressed by: b984aef

Steps to reproduce

  1. Start ST in SAFE MODE
  2. Paste the snippets into a new view
  3. Set syntax to "JavaScript"
  4. Call "Reindent Lines"

Info

  • ST 4130
  • Windows 11
@deathaxe deathaxe added T: bug A bug in an existing language feature C: Indentation Rules labels Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Indentation Rules T: bug A bug in an existing language feature
Projects
None yet
Development

No branches or pull requests

2 participants