void () { initText("line1\nline2\nline3\n"); addCustomFoldRegion(1, 2, 30); assertEquals(new VisualPosition(0, 2), getEditor().logicalToVisualPosition(new LogicalPosition(0, 2))); assertEquals(new VisualPosition(1, 0), getEditor().logicalToVisualPosition(new LogicalPosition(1, 2))); assertEquals(new VisualPosition(1, 0), getEditor().logicalToVisualPosition(new LogicalPosition(1, 10))); assertEquals(new VisualPosition(1, 0), getEditor().logicalToVisualPosition(new LogicalPosition(2, 2))); assertEquals(new VisualPosition(1, 0), getEditor().logicalToVisualPosition(new LogicalPosition(2, 10))); assertEquals(new VisualPosition(2, 2), getEditor().logicalToVisualPosition(new LogicalPosition(3, 2))); assertEquals(new LogicalPosition(0, 2), getEditor().visualToLogicalPosition(new VisualPosition(0, 2))); assertEquals(new LogicalPosition(1, 0), getEditor().visualToLogicalPosition(new VisualPosition(1, 0))); assertEquals(new LogicalPosition(1, 0), getEditor().visualToLogicalPosition(new VisualPosition(1, 1))); assertEquals(new LogicalPosition(1, 0), getEditor().visualToLogicalPosition(new VisualPosition(1, 2))); assertEquals(new LogicalPosition(3, 2), getEditor().visualToLogicalPosition(new VisualPosition(2, 2))); assertEquals(0, getEditor().offsetToVisualLine(5, false)); assertEquals(1, getEditor().offsetToVisualLine(6, false)); assertEquals(1, getEditor().offsetToVisualLine(11, false)); assertEquals(1, getEditor().offsetToVisualLine(12, false)); assertEquals(1, getEditor().offsetToVisualLine(17, false)); assertEquals(2, getEditor().offsetToVisualLine(18, false)); assertEquals(0, ((EditorImpl)getEditor()).visualLineStartOffset(0)); assertEquals(6, ((EditorImpl)getEditor()).visualLineStartOffset(1)); assertEquals(18, ((EditorImpl)getEditor()).visualLineStartOffset(2)); assertEquals(0, getEditor().visualLineToY(0)); assertEquals(12, getEditor().visualLineToY(1)); assertEquals(42, getEditor().visualLineToY(2)); assertEquals(54, getEditor().visualLineToY(3)); assertEquals(0, getEditor().yToVisualLine(0)); assertEquals(0, getEditor().yToVisualLine(11)); assertEquals(1, getEditor().yToVisualLine(12)); assertEquals(1, getEditor().yToVisualLine(13)); assertEquals(2, getEditor().yToVisualLine(42)); assertEquals(2, getEditor().yToVisualLine(53)); assertEquals(3, getEditor().yToVisualLine(54)); assertEquals(new Point(20, 0), getEditor().visualPositionToXY(new VisualPosition(0, 2))); assertEquals(new Point(0, 12), getEditor().visualPositionToXY(new VisualPosition(1, 0))); assertEquals(new Point(0, 12), getEditor().visualPositionToXY(new VisualPosition(1, 1))); assertEquals(new Point(0, 12), getEditor().visualPositionToXY(new VisualPosition(1, 2))); assertEquals(new Point(0, 42), getEditor().visualPositionToXY(new VisualPosition(2, 0))); assertEquals(new Point(20, 42), getEditor().visualPositionToXY(new VisualPosition(2, 2))); assertEquals(new VisualPosition(0, 0), getEditor().xyToVisualPosition(new Point(0, 0))); assertEquals(new VisualPosition(0, 2), getEditor().xyToVisualPosition(new Point(20, 11))); assertEquals(new VisualPosition(1, 0), getEditor().xyToVisualPosition(new Point(0, 12))); assertEquals(new VisualPosition(1, 0), getEditor().xyToVisualPosition(new Point(10, 13))); assertEquals(new VisualPosition(2, 0), getEditor().xyToVisualPosition(new Point(0, 42))); assertEquals(new VisualPosition(2, 2), getEditor().xyToVisualPosition(new Point(20, 53))); assertEquals(new Point(50, 0), getEditor().offsetToXY(5)); assertEquals(new Point(0, 12), getEditor().offsetToXY(6)); assertEquals(new Point(0, 12), getEditor().offsetToXY(11)); assertEquals(new Point(0, 12), getEditor().offsetToXY(17)); assertEquals(new Point(0, 42), getEditor().offsetToXY(18)); }