Debugger / Trace Logger: Clean up newline handling in Copy code (newline may not be 2 characters on different platforms).

This commit is contained in:
jdpurcell 2015-02-08 15:32:56 +00:00
parent a1dcd9928e
commit b3ecd5dd28
2 changed files with 4 additions and 7 deletions

View File

@ -182,13 +182,11 @@ namespace BizHawk.Client.EmuHawk
var blob = new StringBuilder();
foreach (int index in indices)
{
if (blob.Length != 0) blob.AppendLine();
blob.Append(DisassemblyLines[index].Address)
.Append(" ")
.Append(DisassemblyLines[index].Mnemonic)
.AppendLine();
.Append(DisassemblyLines[index].Mnemonic);
}
blob.Remove(blob.Length - 2, 2); // Lazy way to not have a line break at the end
Clipboard.SetDataObject(blob.ToString());
}
}

View File

@ -231,12 +231,11 @@ namespace BizHawk.Client.EmuHawk
var blob = new StringBuilder();
foreach (int index in indices)
{
blob.AppendLine(_instructions[index]
if (blob.Length != 0) blob.AppendLine();
blob.Append(_instructions[index]
.Replace("\r", string.Empty)
.Replace("\n", string.Empty) );
}
blob.Remove(blob.Length - 2, 2); // Lazy way to not have a line break at the end
Clipboard.SetDataObject(blob.ToString());
}
}