Skip to content

Commit 094a410

Browse files
committed
修复文档错误
1 parent 2703fd8 commit 094a410

File tree

2 files changed

+39
-47
lines changed

2 files changed

+39
-47
lines changed

docs/format_config.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -474,29 +474,25 @@ end
474474
互相对齐指的是像switch case一样排版:
475475

476476
```lua
477-
local t = {1,2,3}
478-
local c = {
479-
aaa, bbb, eee
480-
}
481-
local d = {
482-
aa =123,
483-
bbbb = 4353,
484-
eee = 131231,
485-
}
477+
if aa.isDDDD()
478+
and bb == fwfwfw
479+
or hi == 123 then
480+
print(1313)
481+
elseif cc == 123
482+
or dd == 13131 and ddd == 123 then
483+
local ccc = 123
484+
end
486485
```
487-
488-
格式化后:
489-
486+
会被格式化为:
490487
```lua
491-
local t = { 1, 2, 3 }
492-
local c = {
493-
aaa, bbb, eee
494-
}
495-
local d = {
496-
aa = 123,
497-
bbbb = 4353,
498-
eee = 131231,
499-
}
488+
if aa.isDDDD()
489+
and bb == fwfwfw
490+
or hi == 123 then
491+
print(1313)
492+
elseif cc == 123
493+
or dd == 13131 and ddd == 123 then
494+
local ccc = 123
495+
end
500496
```
501497

502498
## end_of_line

docs/format_config_EN.md

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -470,36 +470,32 @@ end
470470

471471
This option represents an expression of the form t[#t+1], which will not be formatted as t[#t + 1]
472472

473-
##if_condition_align_with_each_other
473+
## if_condition_align_with_each_other
474474

475475
This option means that the conditional expressions of the if statement will be aligned with each other. This option is valid if and only if there is an elseif statement, and when this option is valid, the conditional expressions of the if statement must be without indentation.
476476
Alignment with each other refers to typesetting like a switch case:
477477

478-
````lua
479-
local t = {1,2,3}
480-
local c = {
481-
aaa, bbb, eee
482-
}
483-
local d = {
484-
aa =123,
485-
bbbb = 4353,
486-
eee = 131231,
487-
}
488-
````
489-
490-
After formatting:
491-
492-
````lua
493-
local t = { 1, 2, 3 }
494-
local c = {
495-
aaa, bbb, eee
496-
}
497-
local d = {
498-
aa = 123,
499-
bbbb = 4353,
500-
eee = 131231,
501-
}
502-
````
478+
```lua
479+
if aa.isDDDD()
480+
and bb == fwfwfw
481+
or hi == 123 then
482+
print(1313)
483+
elseif cc == 123
484+
or dd == 13131 and ddd == 123 then
485+
local ccc = 123
486+
end
487+
```
488+
after formatting:
489+
```lua
490+
if aa.isDDDD()
491+
and bb == fwfwfw
492+
or hi == 123 then
493+
print(1313)
494+
elseif cc == 123
495+
or dd == 13131 and ddd == 123 then
496+
local ccc = 123
497+
end
498+
```
503499

504500
## end_of_line
505501

0 commit comments

Comments
 (0)