GensaGames
GensaGames

Reputation: 5788

Dart. Idea. How to prevent formatting from merging into single line

I'm trying to set new formatting for me. Because of this problem.

Before auto format.

enter image description here

After auto format. enter image description here

I checked Idea Settings. But seems there are not too many settings for Dart. I have removed all the setting with line merging. But above issue still exist. For example. This setting, which should work, but it doesn't.

enter image description here

Any suggestion?

Upvotes: 5

Views: 1264

Answers (2)

tatumizer
tatumizer

Reputation: 31

End each line you don't want to be affected by formatting with "//":

[1, 2, 3]
      .map((a) => 0) //
      .map((a) => 1); //
var x = [ 
  0, 1, 2, //
  3, 4, 5 //
]; 

Upvotes: 2

Ruyut
Ruyut

Reputation: 181

I have this problem too

My solution is "Select the range I want to auto format and click Ctrl+Alt+L"...

I have given up auto format all...

Upvotes: 0

Related Questions