From 1a591e4a83ebbf41d3a32c21879fdad6cfdc9185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Vonr=C3=BCti?= Date: Sat, 8 Jun 2019 02:39:06 +0200 Subject: Separate java classes with 2 newlines in compiler output view --- lib/compilers/java.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/compilers/java.js') diff --git a/lib/compilers/java.js b/lib/compilers/java.js index 66e53307c..de5a514d4 100644 --- a/lib/compilers/java.js +++ b/lib/compilers/java.js @@ -144,7 +144,12 @@ class JavaCompiler extends BaseCompiler { parseds.sort((o1, o2) => o1.firstSourceLine - o2.firstSourceLine); const segments = []; - parseds.forEach(parsed => { + parseds.forEach((parsed, classNumber) => { + if (classNumber > 0) { + // Separate classes with two line breaks + segments.push({text: "", source: null}); + segments.push({text: "", source: null}); + } for (let i = 0; i < parsed.textsBeforeMethod.length; i++) { // Line-based highlighting doesn't work if some segments span multiple lines, // even if they don't have a source line number -- cgit v1.2.3