LuaFormatter icon indicating copy to clipboard operation
LuaFormatter copied to clipboard

few suggestions

Open shu307 opened this issue 4 years ago • 2 comments

~~allow simple struct to stay in one line~~ ~~t = {a= 1, b=1}~~ allow to chop down all arguments of a function call if there is a line break.

fun (
   aaaaaaaaaaaaaaa,
   bbbbbbbbbbbbb,
   cccccccccccccccc,
   ddddddddddddd
)

shu307 avatar Oct 16 '21 07:10 shu307

This is ok. There is to settings. KV table will chop down only this line's length is greater than the line limit. And, function call you can set the :

align_args: true
break_after_functioncall_lp: true
break_before_functioncall_rp: true

This also need the line length is greater than line limt.

Gowa2017 avatar Oct 16 '21 13:10 Gowa2017

This is ok. There is to settings. KV table will chop down only this line's length is greater than the line limit. And, function call you can set the :

align_args: true
break_after_functioncall_lp: true
break_before_functioncall_rp: true

This also need the line length is greater than line limt.

第一点好像默认就这样,是我用的版本的问题,划掉了。

但第二点做不到的,我说的是chop_down_parameter的效果(args没有)。 其实用习惯了,默认的也还行,就是要看仔细点。

按你说的是这样

fun (
   aaaaaaaaaaaaaaa, bbbbbbbbbbbbb,
   cccccccccccccccc, ddddddddddddd
)

shu307 avatar Oct 20 '21 16:10 shu307