Search in sources :

Example 1 with MoveCaretLeftAction

use of com.intellij.openapi.editor.actions.MoveCaretLeftAction in project intellij-community by JetBrains.

the class XmlSyncTagCommunityTest method testDoNotFireDocumentChangeEventIfTagWasNotChanged.

public void testDoNotFireDocumentChangeEventIfTagWasNotChanged() {
    myFixture.configureByText(XmlFileType.INSTANCE, "<di<caret>></di>");
    type("v");
    Ref<Boolean> eventSent = Ref.create(false);
    myFixture.getEditor().getDocument().addDocumentListener(new DocumentAdapter() {

        @Override
        public void documentChanged(DocumentEvent e) {
            eventSent.set(true);
        }
    }, myFixture.getTestRootDisposable());
    myFixture.testAction(new MoveCaretLeftAction());
    assertFalse(eventSent.get());
}
Also used : MoveCaretLeftAction(com.intellij.openapi.editor.actions.MoveCaretLeftAction) DocumentAdapter(com.intellij.openapi.editor.event.DocumentAdapter) DocumentEvent(com.intellij.openapi.editor.event.DocumentEvent)

Aggregations

MoveCaretLeftAction (com.intellij.openapi.editor.actions.MoveCaretLeftAction)1 DocumentAdapter (com.intellij.openapi.editor.event.DocumentAdapter)1 DocumentEvent (com.intellij.openapi.editor.event.DocumentEvent)1