From 3ea65cf7633f2bc4b7f57268fad37e2e77705115 Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 15 Mar 2016 16:47:10 +0100 Subject: [PATCH] output: limit buffer fixes #4127 --- src/vs/workbench/parts/output/common/outputEditorInput.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/output/common/outputEditorInput.ts b/src/vs/workbench/parts/output/common/outputEditorInput.ts index 82d975cf084..8a1c8c632d4 100644 --- a/src/vs/workbench/parts/output/common/outputEditorInput.ts +++ b/src/vs/workbench/parts/output/common/outputEditorInput.ts @@ -83,7 +83,11 @@ export class OutputEditorInput extends StringEditorInput { private onOutputReceived(e: IOutputEvent): void { if (this.outputSet && e.channel === this.channel) { if (e.output) { - this.bufferedOutput += e.output; + if (this.bufferedOutput.length + e.output.length > MAX_OUTPUT_LENGTH) { + this.bufferedOutput = '...' + this.bufferedOutput.substr(this.bufferedOutput.length + e.output.length - MAX_OUTPUT_LENGTH); + } + + this.bufferedOutput += e.output.substr(0, MAX_OUTPUT_LENGTH); this.scheduleOutputAppend(); } else if (e.output === null) { this.clearValue(); // special output indicates we should clear -- GitLab