int (int offset, int lineIndex) { if (myDocument.getTextLength() == 0) return 0; CharSequence text = myDocument.getCharsSequence(); int start = myDocument.getLineStartOffset(lineIndex); if (start == offset) return 0; return EditorUtil.calcColumnNumber(this, text, start, offset, mySettings.getTabSize(myProject)); }