示例#1
0
 /** Moves caret to the position of currently active pair. */
 public boolean matchPair() {
   if (currentPair == null) return false;
   int caret = text.getCaretOffset();
   int lno = text.getLineAtOffset(caret);
   PairMatch cp = baseEditor.getPairMatch(lno, caret - text.getOffsetAtLine(lno));
   baseEditor.searchGlobalPair(cp);
   if (cp.end == null) return false;
   if (cp.topPosition) text.setSelection(text.getOffsetAtLine(cp.eline) + cp.end.end);
   else text.setSelection(text.getOffsetAtLine(cp.eline) + cp.end.start);
   return true;
 }