void () { int visibleAreaTopY = myEditor.getScrollingModel().getVisibleArea().y; if (visibleAreaTopY == 0) { myLastTopLeftCornerOffset = 0; } else { int visualLine = 1 + myEditor.yToVisualLine(visibleAreaTopY); myLastTopLeftCornerOffset = myEditor.visualLineStartOffset(visualLine); } }