handle linux newlines during paste

This commit is contained in:
haven1433 2025-12-13 09:31:47 -06:00
parent 9c5fa427f9
commit 1fb8ac7924

View File

@ -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;