Arst
Arst

Reputation: 3297

How can I avoid indent for continue curly bracket after reformatting code in Kotlin?

This is what I want

enter image description here

But I actually get this after reformat the code. enter image description here

The reason I want to have that is because without new line it looks like this: enter image description here

Not very tidy...

Upvotes: 2

Views: 687

Answers (1)

Jeel Vankhede
Jeel Vankhede

Reputation: 12118

Not sure if this is what you want but I can point you in to that direction.

Follow the direction below:

In Android Studio Go to,

  1. File -> Settings (Ctrl+Alt+S in windows)
  2. Expand the Editor option-> Expand Code Style option -> Select Kotlin
  3. Select 'Wrapping and Braces' from Tab window there on right pane
  4. Find 'Chained Function calls' there & adjust accordingly

I would suggest following settings:

Select Wrap always for Chained Function calls & Check Use continuation indent, Uncheck Wrap first call if checked previously.

Hope this helps!

Upvotes: 1

Related Questions