Skip to content

[clang-format] Improving LeftWithLastLine display (AlignEscapedNewlines option) #152940

@Julien-Elie

Description

@Julien-Elie

With AlignEscapedNewlines: LeftWithLastLine, could it be possible to only do the alignment when the macro is split across more than 2 lines?
Or have another value to do that?

For instance, I would like

#    define METHOD(name, func, flags, help) \
        {(char *) (name), (func), (flags), (char *) (help)}

to be kept as-is, and not changed to:

#    define METHOD(name, func, flags, help)                 \
        {(char *) (name), (func), (flags), (char *) (help)}

which looks odd.

On the contrary, I prefer

#    define TXN_START(label, tid) \
    label:                        \
        TXN_START_NORETRY(label, tid)

to be formatted as:

#    define TXN_START(label, tid)     \
    label:                            \
        TXN_START_NORETRY(label, tid)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions