Search in sources :

Example 6 with RangeMarkerEx

use of com.intellij.openapi.editor.ex.RangeMarkerEx in project intellij-community by JetBrains.

the class RangeMarkerTest method testSwap.

public void testSwap() {
    RangeMarkerEx marker1 = createMarker("012345678901234567", 5, 6);
    DocumentEx document = (DocumentEx) marker1.getDocument();
    document.createRangeMarker(3, 5);
    document.createRangeMarker(6, 7);
    document.createRangeMarker(4, 4);
    marker1.dispose();
}
Also used : DocumentEx(com.intellij.openapi.editor.ex.DocumentEx) RangeMarkerEx(com.intellij.openapi.editor.ex.RangeMarkerEx)

Example 7 with RangeMarkerEx

use of com.intellij.openapi.editor.ex.RangeMarkerEx in project intellij-community by JetBrains.

the class RangeMarkerTest method testX.

public void testX() {
    RangeMarkerEx marker1 = createMarker(StringUtil.repeatSymbol(' ', 10), 3, 6);
    DocumentEx document = (DocumentEx) marker1.getDocument();
    document.createRangeMarker(2, 3);
    document.createRangeMarker(3, 8);
    document.createRangeMarker(7, 9);
    RangeMarkerEx r1 = (RangeMarkerEx) document.createRangeMarker(6, 8);
    r1.dispose();
    marker1.dispose();
}
Also used : DocumentEx(com.intellij.openapi.editor.ex.DocumentEx) RangeMarkerEx(com.intellij.openapi.editor.ex.RangeMarkerEx)

Aggregations

DocumentEx (com.intellij.openapi.editor.ex.DocumentEx)7 RangeMarkerEx (com.intellij.openapi.editor.ex.RangeMarkerEx)7 Pair (com.intellij.openapi.util.Pair)2 TextRange (com.intellij.openapi.util.TextRange)2 Result (com.intellij.openapi.application.Result)1 WriteCommandAction (com.intellij.openapi.command.WriteCommandAction)1 UndoManagerImpl (com.intellij.openapi.command.impl.UndoManagerImpl)1 WeakList (com.intellij.util.containers.WeakList)1