@Override
	public void caretUpdate(CaretEvent event) {
		// we need to store and remove the specific highlight that
		// we created. If we remove all the highlights, that affects
		// or ability to manually highlight code
		if (pairHighlightTag != null) {
			highlighter.removeHighlight(pairHighlightTag);
			pairHighlightTag = null;
		}
		Token[] pairs;
		try {
			pairs = doc.getTokenAt(event.getDot());
			if (pairs.length > 0) {
				Token pair = pairs[0];
				DocAttributes attr = (DocAttributes) pair.getMeta();
				if (attr.isPair()) {
					pair = attr.getPairedToken();
					pairHighlightTag = highlighter
							.addHighlight(pair.getStartOffset(),
									pair.getEndOffset(), painter);
				}
			}
		} catch (Exception e) {
			// should NOT happen
			e.printStackTrace();
		}

	}