public void TestControlLeftOnLastLine02() { textCore.SetCursorPosition(6, 3); textCore.InsertText("\n"); Assert.AreEqual(textCore.CurrentTextBuffer.GetLineContent(3), " world\n"); // Remove the final line that's made up of just spaces. textCore.SelectLines(4, 0); textCore.DoControlCharacter(System.Windows.Input.Key.Back); // We should end up with 4 entries in text buffer, but since // the last entry ends with a '\n', we should get '5' here. Assert.AreEqual(5, textCore.CurrentTextBuffer.GetLineCount()); // Position the cursor on the 5th line (non-existent line), // and then control-left should bring us back onto line 4. textCore.SetCursorPosition(0, 4); textCore.SetOverrideModifierFlag(TextEditorCommand.Modifier.Control); textCore.DoNavigation(System.Windows.Input.Key.Left); // The cursor is positioned on line 4 last character. Assert.AreEqual(textCore.CursorPosition.X, 9); Assert.AreEqual(textCore.CursorPosition.Y, 3); }
public void TestSelectLines01() { textCore.SelectLines(2, 2); Assert.AreEqual(textCore.GetSelectionText(), "\t\tcruel\n\tworld"); }