EmmyLua / IntelliJ-EmmyLua

Lua IDE/Debugger Plugin for IntelliJ IDEA
https://emmylua.github.io
Apache License 2.0
1.74k stars 293 forks source link

Implemented "Multiple expressions in one line" wrapping setting #398

Open pouwelsjochem opened 3 years ago

pouwelsjochem commented 3 years ago

This enables the user to configure wether they'd like to every statement to be on a single line or not.

Some examples of where multiple statements on a line could be used in Lua:

local object = createMyObject({
    width = 16,
    height = 16
}); object:playAnimation()

or

local newString = string.gsub(oldString, "_suffix", ""); print(newString)
pouwelsjochem commented 3 years ago

Also added the "Chained method calls" settings which can prevent unwanted indentation when chaining method calls

local test = test:test(function()

end)               :test()

Will become this when disabled

local test = test:test(function()

end):test()