summaryrefslogtreecommitdiff
path: root/cli/rt/02_console.js
diff options
context:
space:
mode:
authoruki00a <uki00a@gmail.com>2020-08-10 08:09:09 +0900
committerGitHub <noreply@github.com>2020-08-09 19:09:09 -0400
commit67fe8cd8484611a1cbd72d058539920d09b18cfc (patch)
tree244411e6a1089f91ebd9283d4e9390de6d83ee43 /cli/rt/02_console.js
parent732a43735290f7e996d6252b9820bcca5724f31c (diff)
fix: console.log should see color codes when grouping occurs (#7000)
Diffstat (limited to 'cli/rt/02_console.js')
-rw-r--r--cli/rt/02_console.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/rt/02_console.js b/cli/rt/02_console.js
index 5a9dd4186..1cf47afbe 100644
--- a/cli/rt/02_console.js
+++ b/cli/rt/02_console.js
@@ -371,14 +371,14 @@
let str = "";
let j = i;
for (; j < max - 1; j++) {
- // In future, colors should be taken here into the account
- const padding = maxLineLength[j - i];
+ const lengthOfColorCodes = entries[j].length - dataLen[j];
+ const padding = maxLineLength[j - i] + lengthOfColorCodes;
str += `${entries[j]}, `[order](padding, " ");
}
if (order === "padStart") {
+ const lengthOfColorCodes = entries[j].length - dataLen[j];
const padding = maxLineLength[j - i] +
- entries[j].length -
- dataLen[j] -
+ lengthOfColorCodes -
separatorSpace;
str += entries[j].padStart(padding, " ");
} else {