From 6a259bfafc54549f3ca370cecb2324091abcb0d5 Mon Sep 17 00:00:00 2001 From: Samuel Huang Date: Mon, 22 Apr 2024 09:55:02 -0700 Subject: [PATCH] Simplify the diff --- .editorconfig | 8 -------- .../report/internal/html/page/SourceFilePage.java | 10 ++++------ .../jacoco/report/internal/html/resources/Styles.java | 3 +++ 3 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 751dce40fe..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,8 +0,0 @@ -root = true - -[*.java] -indent_style = tab - -[*.css] -indent_size = 2 -indent_style = space diff --git a/org.jacoco.report/src/org/jacoco/report/internal/html/page/SourceFilePage.java b/org.jacoco.report/src/org/jacoco/report/internal/html/page/SourceFilePage.java index ee7e5cbc6b..2745f5a6ca 100644 --- a/org.jacoco.report/src/org/jacoco/report/internal/html/page/SourceFilePage.java +++ b/org.jacoco.report/src/org/jacoco/report/internal/html/page/SourceFilePage.java @@ -60,9 +60,8 @@ public SourceFilePage(final ISourceNode sourceFileNode, @Override protected void content(final HTMLElement body) throws IOException { - final SourceHighlighter highlighter; - highlighter = new SourceHighlighter(context.getLocale()); - highlighter.render(body, getNode(), sourceReader); + final SourceHighlighter hl = new SourceHighlighter(context.getLocale()); + hl.render(body, getNode(), sourceReader); sourceReader.close(); } @@ -77,9 +76,8 @@ protected void head(final HTMLElement head) throws IOException { @Override protected String getOnload() { - String setTabWidth = format("window['PR_TAB_WIDTH']=%d", tabWidth); - String invokePrettyPrint = "prettyPrint()"; - return setTabWidth + ";" + invokePrettyPrint; + return format("window['PR_TAB_WIDTH']=%d;prettyPrint()", + Integer.valueOf(tabWidth)); } @Override diff --git a/org.jacoco.report/src/org/jacoco/report/internal/html/resources/Styles.java b/org.jacoco.report/src/org/jacoco/report/internal/html/resources/Styles.java index 80d97d6520..78e179b88e 100644 --- a/org.jacoco.report/src/org/jacoco/report/internal/html/resources/Styles.java +++ b/org.jacoco.report/src/org/jacoco/report/internal/html/resources/Styles.java @@ -77,6 +77,9 @@ public final class Styles { /** Block of source code */ public static final String SOURCE = "source"; + /** Line number before each source line */ + public static final String NR = "nr"; + /** Part of source code where instructions are not covered */ public static final String NOT_COVERED = "nc";