Search in sources :

Example 26 with DocumentEx

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

the class RangeMarkerTest method testE10.

public void testE10() {
    DocumentEx document = (DocumentEx) EditorFactory.getInstance().createDocument(StringUtil.repeatSymbol(' ', 10));
    List<RangeMarker> mm = add(document, 9, 9, 6, 8, 8, 8, 5, 9);
    edit(document, 2, 6, 0, 2, 0, 4);
}
Also used : DocumentEx(com.intellij.openapi.editor.ex.DocumentEx)

Example 27 with DocumentEx

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

the class RangeMarkerTest method testE3.

public void testE3() {
    DocumentEx document = (DocumentEx) EditorFactory.getInstance().createDocument(StringUtil.repeatSymbol(' ', 10));
    List<RangeMarker> mm = add(document, 4, 5, 6, 8, 3, 4, 4, 9, 2, 9);
    edit(document, 4, 6, 0);
    delete(mm, 0);
}
Also used : DocumentEx(com.intellij.openapi.editor.ex.DocumentEx)

Example 28 with DocumentEx

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

the class RangeMarkerTest method testE14.

public void testE14() {
    DocumentEx document = (DocumentEx) EditorFactory.getInstance().createDocument(StringUtil.repeatSymbol(' ', 100));
    List<RangeMarker> mm = add(document, 6, 11, 2, 13, 17, 17, 13, 19, 2, 3, 9, 10, 10, 11, 14, 14, 1, 3, 4, 12, 14, 15, 3, 10, 14, 14, 4, 4, 4, 8, 6, 14, 8, 16, 2, 12, 11, 19, 10, 13);
    edit(document, 19, 0, 0, 7, 3, 0, 16, 0, 3);
}
Also used : DocumentEx(com.intellij.openapi.editor.ex.DocumentEx)

Example 29 with DocumentEx

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

the class RangeMarkerTest method testE8.

public void testE8() {
    DocumentEx document = (DocumentEx) EditorFactory.getInstance().createDocument(StringUtil.repeatSymbol(' ', 10));
    List<RangeMarker> mm = add(document, 5, 5, 8, 8, 1, 3, 3, 9);
    edit(document, 4, 3, 0);
}
Also used : DocumentEx(com.intellij.openapi.editor.ex.DocumentEx)

Example 30 with DocumentEx

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

the class RangeMarkerTest method testNested3.

public void testNested3() {
    RangeMarker marker1 = createMarker("01[23]4567890123");
    DocumentEx document = (DocumentEx) marker1.getDocument();
    RangeMarker marker2 = document.createRangeMarker(9, 11);
    RangeMarker marker3 = document.createRangeMarker(1, 12);
    marker3.dispose();
    document.deleteString(marker1.getEndOffset(), marker2.getStartOffset());
}
Also used : DocumentEx(com.intellij.openapi.editor.ex.DocumentEx)

Aggregations

DocumentEx (com.intellij.openapi.editor.ex.DocumentEx)87 Document (com.intellij.openapi.editor.Document)12 NotNull (org.jetbrains.annotations.NotNull)8 RangeMarkerEx (com.intellij.openapi.editor.ex.RangeMarkerEx)7 Project (com.intellij.openapi.project.Project)7 TextRange (com.intellij.openapi.util.TextRange)7 LightVirtualFile (com.intellij.testFramework.LightVirtualFile)7 PsiFile (com.intellij.psi.PsiFile)6 Nullable (org.jetbrains.annotations.Nullable)5 EditorEx (com.intellij.openapi.editor.ex.EditorEx)4 VirtualFile (com.intellij.openapi.vfs.VirtualFile)4 MockVirtualFile (com.intellij.mock.MockVirtualFile)3 FoldRegion (com.intellij.openapi.editor.FoldRegion)3 PsiDocumentManager (com.intellij.psi.PsiDocumentManager)3 DocumentWindow (com.intellij.injected.editor.DocumentWindow)2 DocumentBulkUpdateListener (com.intellij.openapi.editor.ex.DocumentBulkUpdateListener)2 DocumentImpl (com.intellij.openapi.editor.impl.DocumentImpl)2 DocumentMarkupModel (com.intellij.openapi.editor.impl.DocumentMarkupModel)2 RangeHighlighter (com.intellij.openapi.editor.markup.RangeHighlighter)2 FileDocumentManagerAdapter (com.intellij.openapi.fileEditor.FileDocumentManagerAdapter)2