From aa89d7d4969fc12fa9691ce23f135f8f1504e07a Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Thu, 18 Feb 2021 06:13:56 -0800 Subject: [PATCH] Fixed issues with very long errors --- IDE/src/ui/ErrorsPanel.bf | 10 +++++++++- IDE/src/ui/HoverWatch.bf | 2 +- IDE/src/ui/SourceViewPanel.bf | 9 +++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/IDE/src/ui/ErrorsPanel.bf b/IDE/src/ui/ErrorsPanel.bf index 0d13162c..f64e2724 100644 --- a/IDE/src/ui/ErrorsPanel.bf +++ b/IDE/src/ui/ErrorsPanel.bf @@ -276,7 +276,15 @@ namespace IDE.ui SetLabel(item, codeStr); let descItem = item.GetSubItem(1); - String errStr = scope String(32)..Append(error.mError); + String errStr = scope String(32); + int maxLen = 4*1024; + if (error.mError.Length > maxLen) + { + errStr.Append(error.mError.Substring(0, maxLen)); + errStr.Append("..."); + } + else + errStr.Append(error.mError); errStr.Replace('\n', ' '); SetLabel(descItem, errStr); diff --git a/IDE/src/ui/HoverWatch.bf b/IDE/src/ui/HoverWatch.bf index 5fae8f47..77468a09 100644 --- a/IDE/src/ui/HoverWatch.bf +++ b/IDE/src/ui/HoverWatch.bf @@ -738,7 +738,7 @@ namespace IDE.ui String val = scope String(); if (evalString.StartsWith(":", StringComparison.Ordinal)) { - var showString = scope String(evalString, 1); + var showString = scope String(4096)..Append(evalString, 1); bool isShowingDoc = showString.Contains('\x01'); if (!isShowingDoc) { diff --git a/IDE/src/ui/SourceViewPanel.bf b/IDE/src/ui/SourceViewPanel.bf index d25fed70..98a4cf3c 100644 --- a/IDE/src/ui/SourceViewPanel.bf +++ b/IDE/src/ui/SourceViewPanel.bf @@ -5073,7 +5073,11 @@ namespace IDE.ui String showMouseoverString = null; if (bestError.mError != null) { - showMouseoverString = scope:: String(":", bestError.mError); + int maxLen = 16*1024; + if (bestError.mError.Length > maxLen) + showMouseoverString = scope:: String()..Concat(":", StringView(bestError.mError, 0, maxLen), "..."); + else + showMouseoverString = scope:: String()..Concat(":", bestError.mError); if (bestError.mMoreInfo != null) { @@ -5676,7 +5680,8 @@ namespace IDE.ui } } - UpdateMouseover(); + if (gApp.mIsUpdateBatchStart) + UpdateMouseover(); var compiler = ResolveCompiler; var bfSystem = BfResolveSystem;