Skip to content

Question about how to disable / correct one formatting operation #290

Description

@JackBoosY

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions