LuaFormatter icon indicating copy to clipboard operation
LuaFormatter copied to clipboard

Question about how to disable / correct one formatting operation

Open JackBoosY opened this issue 10 months ago • 0 comments

Hi guys, I have a code block that is getting unexpected results when formatting:

if (a == b) and d ~= e and ... and g then
    do_something()
end

which gives me the unexpected result:

if (a == b) and d ~=
e and ... and
g then
    do_something()
end

My expected formatting result is:

if (a == b) and
   d ~= e and
   ... and
   g then
      do_something()
end

I also modified my code to:

if (a == b) and (d ~= e) and ... and g then
    do_something()
end

but also got:

if (a == b) and 
d ~= e and 
... and g then
    do_something()
end

which IMO should be:

if (a == b) and 
   d ~= e and 
   ... and g then
       do_something()
end

My question is which option to correct this?

I tried to set no_break_after_functioncall_lp / no_keep_simple_function_one_line / align_parameter / no_use_tab / align_args but not work.

Thanks.

JackBoosY avatar Oct 11 '23 08:10 JackBoosY