From 5a52e5e9b391a37abfccf7d161bb6dff94e40a9d Mon Sep 17 00:00:00 2001 From: j433866 Date: Mon, 10 Jun 2019 13:08:03 +0100 Subject: [PATCH] Remove new lines from input tab header --- src/web/waiters/InputWaiter.mjs | 2 +- src/web/workers/InputWorker.mjs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/web/waiters/InputWaiter.mjs b/src/web/waiters/InputWaiter.mjs index 6af49259..75df071f 100644 --- a/src/web/waiters/InputWaiter.mjs +++ b/src/web/waiters/InputWaiter.mjs @@ -674,7 +674,7 @@ class InputWaiter { (value.count("\n") + 1) : null; this.setInputInfo(value.length, lines); this.updateInputValue(activeTab, value); - this.manager.tabs.updateInputTabHeader(activeTab, value); + this.manager.tabs.updateInputTabHeader(activeTab, value.replace(/[\n\r]/g, "").slice(0, 100)); if (e && this.badKeys.indexOf(e.keyCode) < 0) { // Fire the statechange event as the input has been modified diff --git a/src/web/workers/InputWorker.mjs b/src/web/workers/InputWorker.mjs index da7b4093..486e9c22 100644 --- a/src/web/workers/InputWorker.mjs +++ b/src/web/workers/InputWorker.mjs @@ -433,6 +433,8 @@ self.updateTabHeader = function(inputNum) { if (typeof inputData !== "string") { inputData = input.data.name; } + inputData = inputData.replace(/[\n\r]/g, ""); + self.postMessage({ action: "updateTabHeader", data: {