doc.insertText(doc.getFirstLine(), 0, "Many\nnew\nlines\n!\n");
assertAnchorLineNumbers(a1, 0, a2, 4);
}
public void testInsertionPlacementStrategyForColumnAnchors() {
Anchor a1 = createAnchorForPlacementStrategy(doc.getFirstLine(), false, 0, EARLIER);
Anchor a2 = createAnchorForPlacementStrategy(doc.getFirstLine(), false, 0, LATER);
assertAnchorColumns(a1, 0, a2, 0);
doc.insertText(doc.getFirstLine(), 0, "a");
assertAnchorColumns(a1, 0, a2, 1);
doc.deleteText(doc.getFirstLine(), 0, doc.getFirstLine().getText().length());
assertAnchorColumns(a1, 0, a2, 0);
doc.insertText(doc.getFirstLine(), 0, "more than a trivial insertion");
assertAnchorColumns(a1, 0, a2, "more than a trivial insertion".length());
doc.insertText(doc.getFirstLine(), 0, "\n");
assertEquals(doc.getFirstLine(), a1.getLine());
assertEquals(doc.getFirstLine().getNextLine(), a2.getLine());
assertAnchorColumns(a1, 0, a2, "more than a trivial insertion".length());
}