Exemple #1
0
  /**
   * Jumps to a search string.
   *
   * @param dir search direction
   * @param select select hit
   * @return new vertical position, or {@code -1}
   */
  int jump(final SearchDir dir, final boolean select) {
    final int pos = text.jump(dir, select);
    if (pos == -1) return -1;

    final int hh = h;
    h = Integer.MAX_VALUE;
    final Graphics g = getGraphics();
    for (init(g); more(g) && text.pos() < pos; next()) ;
    h = hh;
    return y;
  }