protected void possiblyUpdateCurrentLineHighlightLocation() {

		int width = getWidth();
		int lineHeight = getLineHeight();
		int dot = getCaretPosition();

		// If we're wrapping lines we need to check the actual y-coordinate
		// of the caret, not just the line number, since a single logical
		// line can span multiple physical lines.
		if (getLineWrap()) {
			try {
				Rectangle temp = modelToView(dot);
				if (temp!=null) {
					currentCaretY = temp.y;
				}
			} catch (BadLocationException ble) {
				ble.printStackTrace(); // Should never happen.
			}
		}

		// No line wrap - we can simply check the line number (quicker).
		else {
//			Document doc = getDocument();
//			if (doc!=null) {
//				Element map = doc.getDefaultRootElement();
//				int caretLine = map.getElementIndex(dot);
//				Rectangle alloc = ((RTextAreaUI)getUI()).
//											getVisibleEditorRect();
//				if (alloc!=null)
//					currentCaretY = alloc.y + caretLine*lineHeight;
//			}
// Modified for code folding requirements
try {
	Rectangle temp = modelToView(dot);
	if (temp!=null) {
		currentCaretY = temp.y;
	}
} catch (BadLocationException ble) {
	ble.printStackTrace(); // Should never happen.
}
		}

		// Repaint current line (to fill in entire highlight), and old line
		// (to erase entire old highlight) if necessary.  Always repaint
		// current line in case selection is added or removed.
		repaint(0,currentCaretY, width,lineHeight);
		if (previousCaretY!=currentCaretY) {
			repaint(0,previousCaretY, width,lineHeight);
		}

		previousCaretY = currentCaretY;

	}