From 3aa386de49f42e5ada05eb61eb7922ee9fc89830 Mon Sep 17 00:00:00 2001 From: jlewin Date: Wed, 3 Apr 2019 10:59:12 -0700 Subject: [PATCH] Fix TerminalLog.Clear regression --- .../PrinterControls/TerminalWindow/TerminalLog.cs | 4 +++- .../PrinterControls/TerminalWindow/TextScrollWidget.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MatterControlLib/PrinterControls/TerminalWindow/TerminalLog.cs b/MatterControlLib/PrinterControls/TerminalWindow/TerminalLog.cs index 47cb891da..9af2949ed 100644 --- a/MatterControlLib/PrinterControls/TerminalWindow/TerminalLog.cs +++ b/MatterControlLib/PrinterControls/TerminalWindow/TerminalLog.cs @@ -139,7 +139,9 @@ namespace MatterHackers.MatterControl PrinterLines.Clear(); } - this.WriteLine(""); + // HACK: Writing null is has the effect of clearing the terminal log as the widgets clear thier visibleLines list on null. + // Ideally we'd have something more explicit in place that handles the behavior as the effect is less than obvious + this.WriteLine(null); } public void Dispose() diff --git a/MatterControlLib/PrinterControls/TerminalWindow/TextScrollWidget.cs b/MatterControlLib/PrinterControls/TerminalWindow/TextScrollWidget.cs index c979ecd30..8a7fcddaf 100644 --- a/MatterControlLib/PrinterControls/TerminalWindow/TextScrollWidget.cs +++ b/MatterControlLib/PrinterControls/TerminalWindow/TextScrollWidget.cs @@ -137,7 +137,7 @@ namespace MatterHackers.MatterControl public void RebuildFilteredList() { lock (locker) - { + { visibleLines = new List(); var allSourceLinesTemp = allSourceLines.ToArray(); foreach (var lineData in allSourceLinesTemp)