int firstVisible = textArea.getFirstLine(); int lastVisible = firstVisible + textArea.getVisibleLines();  if(firstLine > lastLine) { int tmp = firstLine; firstLine = lastLine; lastLine = tmp; }  if(lastLine < firstVisible || firstLine > lastVisible) return;  firstLine = Math.max(firstLine,firstVisible); lastLine = Math.min(lastLine,lastVisible);  if(firstInvalid == -1 && lastInvalid == -1) { firstInvalid = firstLine; lastInvalid = lastLine; } else { if(firstLine > firstInvalid && lastLine < lastInvalid) return;  firstInvalid = Math.min(firstInvalid,firstLine); lastInvalid = Math.max(lastInvalid,lastLine); }
_invalidateLineRange(firstLine,lastLine);
	public void invalidateLineRange(int firstLine, int lastLine)	{		int firstVisible = textArea.getFirstLine();		int lastVisible = firstVisible + textArea.getVisibleLines();		if(firstLine > lastLine)		{			int tmp = firstLine;			firstLine = lastLine;			lastLine = tmp;		}		if(lastLine < firstVisible || firstLine > lastVisible)			return;		firstLine = Math.max(firstLine,firstVisible);		lastLine = Math.min(lastLine,lastVisible);		if(firstInvalid == -1 && lastInvalid == -1)		{			firstInvalid = firstLine;			lastInvalid = lastLine;		}		else		{			if(firstLine > firstInvalid && lastLine < lastInvalid)				return;			firstInvalid = Math.min(firstInvalid,firstLine);			lastInvalid = Math.max(lastInvalid,lastLine);		}		repaint();	}