Nimpretty issue in lists over 80 chars.

Created on 9 Jul 2019  路  2Comments  路  Source: nim-lang/Nim

This list is long:

const keywords = @[
  "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar",
  "zzz", "ggg", "ddd",
]

nimpretty bug.nim introduces a strange indentation space where there should not be.

const keywords = @[
  "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo",
      "bar", "foo", "bar",
  "zzz", "ggg", "ddd",
]

I expected some thing like:

const keywords = @[
  "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo",
  "bar", "foo", "bar",
  "zzz", "ggg", "ddd",
]
nimpretty

Most helpful comment

I see your expected and I raise ;)

This is what nimpretty does after the fix in https://github.com/nim-lang/Nim/pull/11739:

const keywords = @[
  "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo",
  "bar", "foo", "bar", "zzz", "ggg", "ddd",
]

All 2 comments

I see your expected and I raise ;)

This is what nimpretty does after the fix in https://github.com/nim-lang/Nim/pull/11739:

const keywords = @[
  "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo", "bar", "foo",
  "bar", "foo", "bar", "zzz", "ggg", "ddd",
]

This is nice! Thank you for the fix.

Was this page helpful?
0 / 5 - 0 ratings