int (@NotNull CharSequence text, int startOffset, int startColumn, int offset, int tabSize) { int column = startColumn; for (int i = startOffset; i < offset; i++) { char c = text.charAt(i); if (c == '\t') { column = (column / tabSize + 1) * tabSize; } else if (i + 1 >= text.length() || !Character.isHighSurrogate(c) || !Character.isLowSurrogate(text.charAt(i + 1))) { column++; } } return column; }