char c = buf.getChar(i - 1); while (i > 0 && c != '\n' && c != '\r')
while (i > 0 && !isLineDelimiterChar(buf.getChar(i - 1)))
    public int getIndentUsed(IJavaElement elem, ICompilationUnit cu) throws JavaModelException    {        if (elem instanceof ISourceReference)        {            if (cu != null)            {                IBuffer buf = cu.getBuffer();                int offset = ((ISourceReference) elem).getSourceRange().getOffset();                int i = offset;                // find beginning of line                char c = buf.getChar(i - 1);                while (i > 0 && c != '\n' && c != '\r')                {                    i--;                }                return computeIndent(buf.getText(i, offset - i));            }        }        return 0;    }