Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using Foundation;
using CoreGraphics;

using Mono.Debugging.Client;
using Mono.Debugging.Evaluation;

using MonoDevelop.Core;
Expand Down Expand Up @@ -765,7 +766,7 @@ protected void OnCopy ()
if (SelectedRowCount == 0)
return;

var str = new StringBuilder ();
var builder = new StringBuilder ();
var needsNewLine = false;

var selectedRows = SelectedRows;
Expand All @@ -778,7 +779,7 @@ item.Target is ShowMoreValuesObjectValueNode ||
break;

if (needsNewLine)
str.AppendLine ();
builder.AppendLine ();

needsNewLine = true;

Expand All @@ -794,22 +795,27 @@ item.Target is ShowMoreValuesObjectValueNode ||
var opt = DebuggerService.Frame.GetStackFrame ().DebuggerSession.Options.EvaluationOptions.Clone ();
opt.EllipsizeStrings = false;

var rawValue = (string) objVal.GetRawValue (opt);
var rawValue = objVal.GetRawValue (opt);
var str = rawValue as string;

value = '"' + Mono.Debugging.Evaluation.ExpressionEvaluator.EscapeString (rawValue) + '"';
if (str == null && rawValue is RawValueString rawValueString)
str = rawValueString.Value;

if (str != null)
value = '"' + ExpressionEvaluator.EscapeString (str) + '"';
} catch (EvaluatorException) {
// fall back to using the DisplayValue that we would have used anyway...
}
}
}

str.Append (value);
builder.Append (value);
}

var clipboard = NSPasteboard.GeneralPasteboard;

clipboard.ClearContents ();
clipboard.SetStringForType (str.ToString (), NSPasteboard.NSPasteboardTypeString);
clipboard.SetStringForType (builder.ToString (), NSPasteboard.NSPasteboardTypeString);

//Gtk.Clipboard.Get (Gdk.Selection.Clipboard).Text = str.ToString ();
}
Expand Down