Skip to content

Indentation is wrong when inserting initial newline since 3.1.6 #5924

@mrleblanc101

Description

@mrleblanc101

Vue - Official extension or vue-tsc version

3.2.2

VSCode version

1.107.1

Vue version

3.5.25

System Info

System:
    OS: macOS 26.2
    CPU: (8) arm64 Apple M1 Pro
    Memory: 326.61 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.19.2 - /Users/sleblanc/.nvm/versions/node/v20.19.2/bin/node
    npm: 10.8.2 - /Users/sleblanc/.nvm/versions/node/v20.19.2/bin/npm
    pnpm: 10.14.0 - /Users/sleblanc/.nvm/versions/node/v20.19.2/bin/pnpm
  Browsers:
    Safari: 26.2

Before 3.1.6
Image

After 3.1.6
Image

Steps to reproduce

  • Create a new empty file
  • Select Vue as the langue on the bottom right
  • Type <script setup></script>
  • Press enter between the tags
  • You'll notice that the code is indented by 1 tab (4 space) when it should not

What is expected?

When inserting a new line in the <script>, the content should not be indented.
Either of these settings doesn't seem to be applied.

prettier.vueIndentScriptAndStyle
vue.format.script.initialIndent

Image

What is actually happening?

When pressing enter, there is a useless indentation

Link to minimal reproduction

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions