Commit f64dd35
Fix: don't inline level prefix if breaks occurred inside (#85)
When inlining a level's leading docs, check that no breaks were introduced more robustly.
We already did some validation that the leading docs
(1) don't contain forced breaks, and
(2) can fit onto the current line
However with the new logic added in #71, inner levels might decide to break even when the above two conditions are satisfied.
We guard against this by checking whether the state after the inlining of leading docs has recorded new lines, which would be caused by an inner break being taken.1 parent 6fd07f2 commit f64dd35
File tree
3 files changed
+15
-4
lines changed- changelog/@unreleased
- palantir-java-format/src
- main/java/com/palantir/javaformat/doc
- test/resources/com/palantir/javaformat/java/testdata
3 files changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
300 | 303 | | |
301 | 304 | | |
302 | 305 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
0 commit comments