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

Incidentally removing indents on line when inserting new lines with volar.format.initialIndent set to true in v1.1.2 #2401

Closed
otomad opened this issue Feb 17, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@otomad
Copy link

otomad commented Feb 17, 2023

The last error #2394 is fixed, but now it starts to remove the indents, whether volar.format.initialIndent set to true or false.

settings.json

  "volar.format.initialIndent": {
    "html": true,
    "javascript": true,
    "typescript": true,
  },
  "editor.formatOnType": true,

Before

····const foo = ref();
····const bar = ref();
····const baz = ref();|

After press enter

····const foo = ref();
····const bar = ref();
const baz = ref();
····|
@johnsoncodehk
Copy link
Member

johnsoncodehk commented Feb 17, 2023

Thanks for the report, this is a known limitation, there are too many edge cases to support formatOnType for initialIndent, so the current version (v1.1.2) ignores it for now.

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Feb 17, 2023
@Tanimodori
Copy link

Tanimodori commented Feb 17, 2023

Added a screenshot for this issue. It seems it's a duplicate in my env.

volar2

Repo: volar-starter. Env: Win11, vscode 1.75.1, volar 1.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants