private void printErrLine(int pos, PrintWriter writer) {
        if (!findLine(pos))
            return;

        int lineEnd = lineStart;
        while (lineEnd < buf.length && buf[lineEnd] != CR && buf[lineEnd] != LF)
            lineEnd++;
        if (lineEnd - lineStart == 0)
            return;
        printLines(writer, new String(buf, lineStart, lineEnd - lineStart));
        for (bp = lineStart; bp < pos; bp++) {
            writer.print((buf[bp] == '\t') ? "\t" : " ");
        }
        writer.println("^");
        writer.flush();
    }