trixnz / lua-fmt

lua-fmt is pretty-printer for Lua code
MIT License
189 stars 25 forks source link

Inconsistent formatting depending on file's line ending #24

Open henriquegemignani opened 6 years ago

henriquegemignani commented 6 years ago

If the file uses CRLF as line endings, the lua-fmt gives this formatting:

pluralization[f4] =
    words(
    [[
  az bm bo dz fa hu id ig ii ja jv ka kde kea km kn
  ko lo ms my root sah ses sg th to tr vi wo yo zh
]]
)

When the file uses LF, the output is as follows:

pluralization[f4] =
    words([[
  az bm bo dz fa hu id ig ii ja jv ka kde kea km kn
  ko lo ms my root sah ses sg th to tr vi wo yo zh
]])

Obs: renaming words to wordsss, the output is then consistent no matter the line endings:

pluralization[f4] =
    wordsss(
    [[
  az bm bo dz fa hu id ig ii ja jv ka kde kea km kn
  ko lo ms my root sah ses sg th to tr vi wo yo zh
]]
)

Running lua-fmt via vscode-lua 0.12.4

qaisjp commented 6 years ago

CLLF? Do you mean CRLF?

qaisjp commented 6 years ago

First hunch is line length checking... at first glance it doesn't seem easy to fix without a performance impact (or breaking files with mixed line endings)

henriquegemignani commented 6 years ago

Yeah, CRLF sorry.