-
Hello, I am trying to set up Somewhere in the code, inside a for row <- zeroCells.rows.indices do
if zeroCells.rows(row) == 1 then
for col <- m(row).indices do
m(row)(col) = 0 However, when I format with for row <- zeroCells.rows.indices do if zeroCells.rows(row) == 1 then for col <- m(row).indices do m(row)(col) = 0 which is hard to read. I'd like to preserve this sort of line break and indentation (the original snippet I've shown). Scalafmt does seem to format the following snippet as I expect (see, however, that I have added two for col <- zeroCells.cols.indices do
if zeroCells.cols(col) == 1 then
println("a") // This was added
for row <- m.indices do
println("b") // This was added
m(row)(col) = 0 I have seen this similar issue from 2016: #366, but most of the links are broken, and I can no longer find the directive
in the documentation for scalafmt 3.7.4. It also may be that what I am looking for is not related to the issue #366, since my issue is not really related with chains. Is there a directive I am missing to achieve the expected behavior? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@vicaba rather than searching through old issues, I'd recommend re-reading the documentation. One option is: https://scalameta.org/scalafmt/docs/configuration.html#newlinessource |
Beta Was this translation helpful? Give feedback.
@vicaba rather than searching through old issues, I'd recommend re-reading the documentation. One option is: https://scalameta.org/scalafmt/docs/configuration.html#newlinessource