Exemple #1
0
        protected override void Run()
        {
            for (int i = 0; i < Count; i++)
            {
                MiscActions.Undo(Editor);
            }

            Editor.ClearSelection();
        }
Exemple #2
0
        public void TestUndo()
        {
            // Undo/Redo subsystem is tested separately, this only checks if the action is working.
            var data = Create("foo$");

            data.InsertAtCaret("bar");
            Check(data, "foobar$");
            MiscActions.Undo(data);
            Check(data, "foo$");
        }
Exemple #3
0
 /// <summary>
 /// The Undo menu item handler
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 private void OnUndo(object sender, EventArgs e)
 {
     try
     {
         MiscActions.Undo(textEditor.TextArea.GetTextEditorData());
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
        public void TestUndoSteps_WithoutFormattingStep()
        {
            var data = Create(
                @"$");

            data.Options.GenerateFormattingUndoStep = false;
            Clipboard clipboard = Clipboard.Get(Mono.TextEditor.ClipboardActions.CopyOperation.CLIPBOARD_ATOM);

            clipboard.Text = "hello";

            data.TextPasteHandler = this;

            ClipboardActions.Paste(data);

            Check(data, @"Hello World$");
            MiscActions.Undo(data);
            Check(data, @"$");
        }
Exemple #5
0
        public void TestUndoSteps()
        {
            var data = Create(
                @"$");

            Clipboard clipboard = Clipboard.Get(Mono.TextEditor.ClipboardActions.CopyOperation.CLIPBOARD_ATOM);

            clipboard.Text = "hello";

            data.TextPasteHandler = this;

            ClipboardActions.Paste(data);

            Check(data, @"Hello World$");
            MiscActions.Undo(data);
            Check(data, @"hello$");
            MiscActions.Undo(data);
            Check(data, @"$");
        }
Exemple #6
0
 /// <summary>
 /// The Undo menu item handler
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 private void OnUndo(object sender, EventArgs e)
 {
     MiscActions.Undo(textEditor.TextArea.GetTextEditorData());
 }