Swiftformat: Color literals

Created on 25 Sep 2020  路  3Comments  路  Source: nicklockwood/SwiftFormat

There are some issues related to color literals. Here is the example. Do we miss any rule which will fix it and make one line ?

Screen Shot 2020-09-25 at 12 06 11

bug fixed in develop

Most helpful comment

I'll add a fix for this in the next update. I think the only way to prevent this from wrapping at the moment is to disable the wrap rule, or set --maxwidth to none.

All 3 comments

This is arguably a bug. I should probably have an option to treat color literals as 1 or 2 characters for the purposes pf wrapping.

I'll add a fix for this in the next update. I think the only way to prevent this from wrapping at the moment is to disable the wrap rule, or set --maxwidth to none.

@AniHovhannisyanAni I've added a new --assetliterals option to control how color/image literals are handled. By default they'll now be treated as having a width of 2 characters.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shawnkoh picture shawnkoh  路  3Comments

mdiep picture mdiep  路  3Comments

igorkulman picture igorkulman  路  3Comments

PompeiaPaetenari picture PompeiaPaetenari  路  4Comments

MaxDesiatov picture MaxDesiatov  路  3Comments