From 67fe8cd8484611a1cbd72d058539920d09b18cfc Mon Sep 17 00:00:00 2001 From: uki00a Date: Mon, 10 Aug 2020 08:09:09 +0900 Subject: fix: console.log should see color codes when grouping occurs (#7000) --- cli/rt/02_console.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/rt') 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 { -- cgit v1.2.3