CppCXY / EmmyLuaCodeStyle

fast, powerful, and feature-rich Lua formatting and checking tool.
MIT License
140 stars 27 forks source link

Separate Continuation Indent for Block Statements #156

Closed firas-assaad closed 11 months ago

firas-assaad commented 11 months ago

Thanks for developing this formatter!

I use a convention of 4 spaces for continued lines for regular statements, but 8 spaces for lines after the start of a block (e.g. if statement, function declaration, loops) to clearly distinguish the block container from the statements inside it:


local regular_statement = 'hello '
    .. 'world

function func(a, b,
        c, d)
    print('hi')
end

if a > 2
        and b == 5
        and c = 3
    return 1
end

As far as I can tell continuation_indent applies to both cases. Is there a way to have a different indent before statements inside a block?

CppCXY commented 11 months ago

I'm sick, I'll implement it in a few days.

firas-assaad commented 11 months ago

I'm sick, I'll implement it in a few days.

It's not really urgent, but thanks for taking the time to reply. I hope you get well soon!

CppCXY commented 11 months ago

after update you can set continuation_indent.before_block = 8