int[] (float startX, float x) { if (x <= startX) return new int[] {0, 0}; float nextTabStop = getNextTabStop(startX); if (x > nextTabStop) return new int[] {getVisualColumnCount(startX), 1}; int column; boolean closerToLargerColumns; if (myEditor.getSettings().isCaretInsideTabs()) { float plainSpaceWidth = myView.getPlainSpaceWidth(); column = Math.round((x - startX)/plainSpaceWidth); closerToLargerColumns = (x - startX) > (column * plainSpaceWidth); } else { column = x > (startX + nextTabStop) / 2 ? getVisualColumnCount(startX) : 0; closerToLargerColumns = column == 0; } return new int[] {column, closerToLargerColumns ? 1 : 0}; }