setVisible(false, false);
}
int dot = tc.getCaretPosition();
int selStart = tc.getSelectionStart()-1; // Workaround for Java Highlight issues.
Highlight currentPrev = null;
int pos = 0;
Highlighter h = tc.getHighlighter();
Highlight[] highlights = h.getHighlights();
for (int i=0; i<highlights.length; i++) {
Highlight hl = highlights[i];
if (hl.getPainter()==p) { // Only way to identify our own highlights
if (currentPrev==null || currentPrev.getStartOffset()>=dot ||
(hl.getStartOffset()<selStart &&
hl.getStartOffset()>currentPrev.getStartOffset())) {
currentPrev = hl;
pos = i;
}
}
}