2

What happened is that when I move my codes to different lines, and when I CTRL+S, the code automatically get moved to a different line.

enter image description here

What setting in VS Code is this?

3 Answers 3

2

That's because you have format on save.

You need to go to VS Code settings and search formatOnSave and turn it off

2

check if the "auto format on save" option is on: VSCode: How do you autoformat on save?

you can also go into the dart plugin's preferences in vscode and change the line length at which formatting the code will auto-wrap it. You can make it however long you want. Just go into settings and search "Dart: Line Length"

0

For me, I went to the dart extension setting, there is an option of Dart: Enable SDK Formatter. It should be the problem I guess because when I disabled it, everything started working fine.

We can directly search for Dart: Enable SDK Formatter in VS Code settings.

1
  • 1
    This will disable the dart formatter completely. OP just doesn't want it to run on save.
    – Banana
    Commented Mar 13, 2022 at 16:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.