+7
-3
lines changedFilter options
+7
-3
lines changed Original file line number Diff line number Diff line change
@@ -397,6 +397,10 @@ boolean isReal() {
397
397
private final Indent plusIndentCommentsBefore;
398
398
private final Optional<Indent> breakAndIndentTrailingComment;
399
399
400
+
private Input.Tok tok() {
401
+
return token.getTok();
402
+
}
403
+
400
404
private Token(
401
405
Input.Token token,
402
406
RealOrImaginary realOrImaginary,
@@ -465,7 +469,8 @@ public void add(DocBuilder builder) {
465
469
466
470
@Override
467
471
int computeWidth() {
468
-
return token.getTok().length();
472
+
int idx = Newlines.firstBreak(tok().getOriginalText());
473
+
return (idx >= 0) ? MAX_LINE_WIDTH : tok().length();
469
474
}
470
475
471
476
@Override
@@ -480,8 +485,7 @@ Range<Integer> computeRange() {
480
485
481
486
@Override
482
487
public State computeBreaks(CommentsHelper commentsHelper, int maxWidth, State state) {
483
-
String text = token.getTok().getOriginalText();
484
-
return state.withColumn(state.column + text.length());
488
+
return state.withColumn(state.column + computeWidth());
485
489
}
486
490
487
491
@Override
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4