public void TestLinkRemoval() { var editor = CreateEditorWithLinks(@"[0foo] [0foo] [0foo]", out var links); editor.Options.IndentStyle = IndentStyle.Auto; var oldLocation = editor.Caret.Location; var tle = new TextLinkEditMode(editor, 0, links); tle.StartMode(); DeleteActions.Backspace(editor.GetTextEditorData()); tle.ExitTextLinkMode(); Assert.AreEqual(" ", editor.Text); }
public void TestLinkReplace() { var editor = CreateEditorWithLinks(@"[0foo] [0foo] [0foo]", out var links); editor.Options.IndentStyle = IndentStyle.Auto; var oldLocation = editor.Caret.Location; var tle = new TextLinkEditMode(editor, 0, links); tle.StartMode(); editor.InsertAtCaret("bar"); tle.ExitTextLinkMode(); Assert.AreEqual("bar bar bar", editor.Text); }
public void TestVSTS627497() { var editor = CreateEditorWithLinks(@"[0class] Test { void TestMethod () { $ } }", out var links); var oldLocation = editor.Caret.Location; var tle = new TextLinkEditMode(editor, 0, links); tle.StartMode(); DeleteActions.Backspace(editor.GetTextEditorData()); editor.InsertAtCaret("struct"); tle.ExitTextLinkMode(); Assert.AreEqual(oldLocation, editor.Caret.Location); }