From 1fb8ac7924e355ac34bd9bca43d10f545538a54c Mon Sep 17 00:00:00 2001 From: haven1433 Date: Sat, 13 Dec 2025 09:31:47 -0600 Subject: [PATCH] handle linux newlines during paste --- src/HexManiac.Core/ViewModels/Tools/CodeTool.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HexManiac.Core/ViewModels/Tools/CodeTool.cs b/src/HexManiac.Core/ViewModels/Tools/CodeTool.cs index dba25dd1..30f34526 100644 --- a/src/HexManiac.Core/ViewModels/Tools/CodeTool.cs +++ b/src/HexManiac.Core/ViewModels/Tools/CodeTool.cs @@ -394,7 +394,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Tools { if (start > end) (start, end) = (end, start); int length = end - start + 1; int originalLength = length; - var code = thumb.Compile(model, start, out var newRuns, Content.Split(Environment.NewLine)); + var code = thumb.Compile(model, start, out var newRuns, Content.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.None)); // if more length is needed and the next available bytes are free, allow it. while (code.Count > length && model.Count > start + length + 1 && model[start + length] == 0xFF && model[start + length + 1] == 0xFF) length += 2;