undo of a completion finished by enter/tab/smart-enter behaves first as if that action was just performed without any completion

This commit is contained in:
peter
2011-07-25 20:00:29 +02:00
parent e822b4f8e6
commit a803fbed45
6 changed files with 122 additions and 51 deletions
@@ -851,6 +851,28 @@ class LiveComplete {
assert myFixture.editor.document.text.contains('ArrStoExce.')
}
public void testEnterSelectionUndo() {
myFixture.configureByText "a.java", "class Foo {{ <caret> }}"
def editor = openEditorForUndo();
type('ArrStoExce\n')
edt { UndoManager.getInstance(project).undo(editor) }
assert myFixture.editor.document.text.contains('ArrStoExce\n')
}
public void testTabSelectionUndo() {
myFixture.configureByText "a.java", "class Foo {{ <caret>x }}"
def editor = openEditorForUndo();
type('ArrStoExce\t')
myFixture.checkResult("class Foo {{ ArrayStoreException<caret> }}")
edt { UndoManager.getInstance(project).undo(editor) }
assert myFixture.editor.document.text.contains('ArrStoExce x')
edt { UndoManager.getInstance(project).undo(editor) }
myFixture.checkResult("class Foo {{ ArrStoExce<caret>x }}")
}
public void testAutopopupTypingUndo() {
myFixture.configureByText "a.java", "class Foo {{ <caret> }}"
def editor = openEditorForUndo();