Ejemplo n.º 1
0
        public void TestDelete()
        {
            var data = Create(@"1234$567890");

            DeleteActions.Delete(data);
            Check(data, @"1234$67890");
        }
Ejemplo n.º 2
0
        public void TestBackspaceDeleteCase1()
        {
            var data = Create(@"1234567890$");

            DeleteActions.Delete(data);
            Check(data, @"1234567890$");
        }
Ejemplo n.º 3
0
        public void TestDeleteUTF32()
        {
            var data = Create(@"12$🚀34");

            DeleteActions.Delete(data);
            Check(data, @"12$34");
        }
        public void TestBackspaceDeleteCase1()
        {
            TextEditorData data = CaretMoveActionTests.Create(@"1234567890$");

            DeleteActions.Delete(data);
            Assert.AreEqual(new DocumentLocation(0, 10), data.Caret.Location);
            Assert.AreEqual("1234567890", data.Document.Text);
        }
Ejemplo n.º 5
0
        public void TestSmartDeleteBehaviorBug1()
        {
            var data = CreateData("\n\t\tFoo\n\t\t Bar");

            data.Caret.Location = new DocumentLocation(2, 6);
            DeleteActions.Delete(data);
            Assert.AreEqual(new DocumentLocation(2, 6), data.Caret.Location);
            Assert.AreEqual("\n\t\tFooBar", data.Document.Text);
        }
        public void TestDelete()
        {
            TextEditorData data = CaretMoveActionTests.Create(@"1234$567890");

            Assert.AreEqual(new DocumentLocation(0, 4), data.Caret.Location);
            DeleteActions.Delete(data);
            Assert.AreEqual(new DocumentLocation(0, 4), data.Caret.Location);
            Assert.AreEqual("123467890", data.Document.Text);
        }
Ejemplo n.º 7
0
        public void TestBug5067()
        {
            var data = CreateData("\n\n\t\tFoo ();\n");

            data.Caret.Location = new DocumentLocation(2, 3);
            SelectionActions.MoveDown(data);
            DeleteActions.Delete(data);

            Assert.AreEqual("\n\t\tFoo ();\n", data.Document.Text);
        }
Ejemplo n.º 8
0
        public void TestDeleteBehavior()
        {
            var data = CreateData("\n\t\ttest");

            data.Caret.Location = new DocumentLocation(2, 3);
            CaretMoveActions.Up(data);
            Assert.AreEqual(new DocumentLocation(1, 3), data.Caret.Location);
            DeleteActions.Delete(data);
            Assert.AreEqual("\t\ttest", data.Document.Text);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// The Delete menu handler
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 private void OnDelete(object sender, EventArgs e)
 {
     try
     {
         DeleteActions.Delete(textEditor.TextArea.GetTextEditorData());
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
Ejemplo n.º 10
0
        public void TestDeleteSelectionBehavior()
        {
            var data = CreateData("\n\t\ttest\n\n");

            data.Caret.Location = new DocumentLocation(2, 3);
            SelectionActions.MoveUp(data);
            Assert.AreEqual(new DocumentLocation(1, 3), data.Caret.Location);
            Assert.IsTrue(data.IsSomethingSelected);
            DeleteActions.Delete(data);
            Assert.AreEqual(new DocumentLocation(1, 3), data.Caret.Location);
            Assert.AreEqual("\t\ttest\n\n", data.Document.Text);
        }
Ejemplo n.º 11
0
        protected override void Run()
        {
            if (Char.IsControl(Argument))
            {
                return;
            }

            Editor.SetSelection(Editor.Caret.Offset, Editor.Caret.Offset + 1);
            DeleteActions.Delete(Editor);
            Editor.InsertAtCaret(Char.ToString(Argument));
            Editor.Caret.Offset--;
        }
Ejemplo n.º 12
0
        public void TestDeleteNoUpdate()
        {
            var editor = new MonoTextEditor();

            editor.GetTextEditorData().Document.SyntaxMode = new TestSyntaxMode();
            editor.Text           = @"1
2
3
4
5";
            editor.Caret.Location = new DocumentLocation(2, 1);
            DeleteActions.Delete(editor.GetTextEditorData());
            Assert.IsFalse(editor.TextViewMargin.SpanUpdater.HasUpdatedMultilineSpan);
        }
        public void TestDelete()
        {
            var data = Create(
                @"1234567890
1234<-567890
1234567890
1234567890
1234->$567890
1234567890");

            data.MainSelection = data.MainSelection.WithSelectionMode(SelectionMode.Block);
            DeleteActions.Delete(data);
            Check(data, @"1234567890
1234<-67890
123467890
123467890
1234->$67890
1234567890");
        }
Ejemplo n.º 14
0
 /// <summary>
 /// The Delete menu handler
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 private void OnDelete(object sender, EventArgs e)
 {
     DeleteActions.Delete(textEditor.TextArea.GetTextEditorData());
 }