public static void Cut(TextEditorData data)
 {
     if (data.IsSomethingSelected && data.CanEditSelection)
     {
         Copy(data);
         DeleteActions.Delete(data);
     }
     else
     {
         Copy(data);
         DeleteActions.CaretLine(data);
     }
 }
Beispiel #2
0
            public void CopyData(TextEditorData data)
            {
                MonoDevelop.Ide.Editor.Selection selection;
                isLineSelectionMode = !data.IsSomethingSelected;
                if (data.IsSomethingSelected)
                {
                    selection = data.MainSelection;
                }
                else
                {
                    var start = DeleteActions.GetStartOfLineOffset(data, data.Caret.Location);
                    var end   = DeleteActions.GetEndOfLineOffset(data, data.Caret.Location, false);
                    selection = new MonoDevelop.Ide.Editor.Selection(data.OffsetToLocation(start), data.OffsetToLocation(end));
                }
                CopyData(data, selection);

                if (Copy != null)
                {
                    Copy(GetCopiedPlainText());
                }
            }
            public void CopyData(TextEditorData data)
            {
                Selection selection;

                isLineSelectionMode = !data.IsSomethingSelected;
                if (data.IsSomethingSelected)
                {
                    selection = data.MainSelection;
                }
                else
                {
                    var start = DeleteActions.GetStartOfLineOffset(data, data.Caret.Location);
                    var end   = DeleteActions.GetEndOfLineOffset(data, data.Caret.Location, false);
                    selection = new Selection(data.OffsetToLocation(start), data.OffsetToLocation(end));
                }
                CopyData(data, selection);

                if (Copy != null)
                {
                    Copy(copiedDocument != null ? copiedDocument.Text : null);
                }
            }