int (@NotNull CharSequence text, int start, int offset, int tabSize) { if (myUseNewRendering) return myView.offsetToLogicalPosition(offset).column; IterationState state = new IterationState(this, start, offset, false); int fontType = state.getMergedAttributes().getFontType(); int column = 0; int x = 0; int plainSpaceSize = EditorUtil.getSpaceWidth(Font.PLAIN, this); for (int i = start; i < offset; i++) { if (i >= state.getEndOffset()) { state.advance(); fontType = state.getMergedAttributes().getFontType(); } SoftWrap softWrap = getSoftWrapModel().getSoftWrap(i); if (softWrap != null) { x = softWrap.getIndentInPixels(); } char c = text.charAt(i); if (c == '\t') { int prevX = x; x = EditorUtil.nextTabStop(x, this); column += EditorUtil.columnsNumber(c, x, prevX, plainSpaceSize); } else { x += EditorUtil.charWidth(c, fontType, this); column++; } } return column; }