From ce16f17081e34f2588775410cf2272dab5450b80 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Fri, 31 May 2019 20:34:07 +0100 Subject: [PATCH] Fix MRC MLTEV padding bug --- core/mrc.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/mrc.js b/core/mrc.js index d696c9e7..172466a9 100644 --- a/core/mrc.js +++ b/core/mrc.js @@ -178,14 +178,17 @@ exports.getModule = class mrcModule extends MenuModule { const messageLength = stripMciColorCodes(message).length; const chatWidth = chatLogView.dimens.width; let padAmount = 0; + let spaces = 2; if (messageLength > chatWidth) { - padAmount = chatWidth - (messageLength % chatWidth); + padAmount = chatWidth - (messageLength % chatWidth) - spaces; } else { - padAmount = chatWidth - messageLength; + padAmount = chatWidth - messageLength - spaces ; } - const padding = ' |00' + ' '.repeat(padAmount - 2); + if (padAmount < 0) padAmount = 0; + + const padding = ' |00' + ' '.repeat(padAmount); chatLogView.addText(pipeToAnsi(message + padding)); }