improve 'got a crash' copied text

copy a number of lines that varies based on the number of tabs.
This commit is contained in:
Haven1433 2022-09-10 20:27:39 -05:00
parent 15d3b6d411
commit 0db2ce46e1

View File

@ -92,7 +92,9 @@ namespace HavenSoft.HexManiac.WPF.Windows {
text.AppendLine("-------------------------------------------");
text.AppendLine(Environment.NewLine);
File.AppendAllText("crash.log", text.ToString());
var shortError = Environment.NewLine.Join(text.ToString().SplitLines().Take(20));
var editor = DataContext as EditorViewModel;
var tabCount = editor?.Count ?? 0;
var shortError = Environment.NewLine.Join(text.ToString().SplitLines().Take(15 + tabCount * 5));
shortError = Environment.NewLine.Join(new[] {
$"~I got a crash! ({ViewModel.Singletons.MetadataInfo.VersionNumber})",
"```",