Commit 5d688a0
committed
fix(formatter): measuring multiline text in
Regressed by #15372. The changes are made to match previous behavior. In `fits_text`, once the text width is multiple lines, we should check whether the current line width plus the width of the text to the first line break is greater than the allowed line width to take action, but previously, we didn't include `plus the width of the text to the first line break`.fits_text is incorrect (#15762)1 parent e306958 commit 5d688a0
File tree
4 files changed
+37
-21
lines changed- crates/oxc_formatter
- src/formatter
- format_element
- printer
- tests/fixtures/js/calls
4 files changed
+37
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
415 | 416 | | |
416 | | - | |
| 417 | + | |
| 418 | + | |
417 | 419 | | |
418 | 420 | | |
419 | 421 | | |
| |||
424 | 426 | | |
425 | 427 | | |
426 | 428 | | |
427 | | - | |
| 429 | + | |
428 | 430 | | |
429 | 431 | | |
430 | 432 | | |
| |||
444 | 446 | | |
445 | 447 | | |
446 | 448 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | 449 | | |
455 | | - | |
| 450 | + | |
456 | 451 | | |
457 | 452 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
630 | | - | |
| 629 | + | |
| 630 | + | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
634 | | - | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
635 | 641 | | |
636 | 642 | | |
637 | 643 | | |
638 | | - | |
| 644 | + | |
639 | 645 | | |
640 | 646 | | |
641 | 647 | | |
| |||
1171 | 1177 | | |
1172 | 1178 | | |
1173 | 1179 | | |
1174 | | - | |
1175 | | - | |
| 1180 | + | |
| 1181 | + | |
1176 | 1182 | | |
1177 | | - | |
| 1183 | + | |
| 1184 | + | |
1178 | 1185 | | |
1179 | | - | |
| 1186 | + | |
| 1187 | + | |
1180 | 1188 | | |
1181 | 1189 | | |
1182 | 1190 | | |
1183 | 1191 | | |
1184 | 1192 | | |
1185 | 1193 | | |
1186 | | - | |
| 1194 | + | |
1187 | 1195 | | |
1188 | 1196 | | |
1189 | 1197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
60 | 69 | | |
0 commit comments