Skip to content

Commit cc9e520

Browse files
committed
fix copying diagnostic text
1 parent 93e2330 commit cc9e520

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ public override void _GuiInput(InputEvent @event)
577577
}
578578
if (@event.IsActionPressed(InputStringNames.Copy))
579579
{
580-
if (_symbolInfoRichTextLabel is not null)
580+
if (_symbolInfoRichTextLabel is not null && _symbolInfoRichTextLabel.GetSelectionFrom() is not -1)
581581
{
582582
var selectedText = _symbolInfoRichTextLabel.GetSelectedText();
583583
if (!string.IsNullOrEmpty(selectedText))
@@ -586,7 +586,7 @@ public override void _GuiInput(InputEvent @event)
586586
DisplayServer.ClipboardSet(selectedText);
587587
}
588588
}
589-
else if (_diagnosticInfoRichTextLabel is not null)
589+
else if (_diagnosticInfoRichTextLabel is not null && _diagnosticInfoRichTextLabel.GetSelectionFrom() is not -1)
590590
{
591591
var selectedText = _diagnosticInfoRichTextLabel.GetSelectedText();
592592
if (!string.IsNullOrEmpty(selectedText))

0 commit comments

Comments
 (0)