EmmyLuaCodeStyle
EmmyLuaCodeStyle copied to clipboard
一排if-elseif的换行问题
trafficstars
Discussed in https://github.com/CppCXY/EmmyLuaCodeStyle/discussions/140
Originally posted by MrZ626 September 12, 2023
if a then a()
elseif b then b()
elseif c then c()
else d()
end
有时候我会这么写,但是目前的格式化风格好像不允许这种写法?翻了一圈没找着 会被格式化成
if a then
a()
elseif b then
b()
elseif c then
c()
else
d()
end
就太长了
还有一些形如function() a() b() end的包含两个语句的短行我也不希望被拆开,可以考虑加个选项不拆分这些情况吗?
最终需求应该是,允许控制每种语句块(if for while)后换行的条件:always必定换行,smart单条语句不换行,never永不主动换行
@CppCXY (不知道discussion会不会通知 保险at一下)
要不要给你个机会自己实现 @MrZ626
可以试下,不过最近这周比较忙,之后就来再细看看