A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/google/google-java-format/commit/9bdae025b7b023d45636e707c9225d0cdd66eb0b below:

Support multiline tokens in GJF-core · google/google-java-format@9bdae02 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+7

-3

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+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