return getBufferLength();
{   return getLineEndOffset(buffer.virtualToPhysical( buffer.getVirtualLineCount() - 1)) - 1; }
	public int xyToOffset(int x, int y)	{		FontMetrics fm = painter.getFontMetrics();		int height = fm.getHeight();		int line = y / height + firstLine;		if(line < 0)			return 0;		else if(line >= getVirtualLineCount())			return getBufferLength();		else		{			line = buffer.virtualToPhysical(line);			return getLineStartOffset(line) + xToOffset(line,x);		}	}