Skip to content

Commit ddc8c39

Browse files
committed
fix english doc error
1 parent 094a410 commit ddc8c39

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

docs/format_action_EN.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ local ttt = 123 --first
6060
cd = 345 --second
6161
```
6262

63-
格式化后:
63+
Will be formatted as:
6464

6565
```lua
6666
local ttt = 123 --first
@@ -101,6 +101,35 @@ local d = {
101101
}
102102
```
103103

104+
## if statement is aligned
105+
106+
lua does not have a switch statement, generally simulates a match list through if/elseif, for other languages with switch statements, the format will align the case, and this behavior is also supported here:
107+
108+
```lua
109+
if aa.isDDDD()
110+
and bb == fwfwfw
111+
or hi == 123 then
112+
print(1313)
113+
elseif cc == 123
114+
or dd == 13131 and ddd == 123 then
115+
local ccc = 123
116+
end
117+
```
118+
will be formatted as:
119+
```lua
120+
if aa.isDDDD()
121+
and bb == fwfwfw
122+
or hi == 123 then
123+
print(1313)
124+
elseif cc == 123
125+
or dd == 13131 and ddd == 123 then
126+
local ccc = 123
127+
end
128+
```
129+
130+
This attribute is not the default behavior
131+
132+
104133
## Long expression list
105134

106135
If the long expression list and the long expression have more than one line, except for the first line, the remaining lines will be indented by one continuation line:

0 commit comments

Comments
 (0)