Example #1
0
  public TextRange rightDelimiter(int offset, EditorAdaptor editorAdaptor, int count)
      throws CommandExecutionException {
    Position right = rightMotion.destination(offset, editorAdaptor, count);

    Position rightDelim =
        VimUtils.fixRightDelimiter(
            editorAdaptor.getModelContent(), editorAdaptor.getCursorService(), right);

    return new StartEndTextRange(rightDelim, right.addModelOffset(1));
  }
Example #2
0
  /**
   * Vim doesn't start a delimited range on a newline or end a range on an empty line (try 'vi{'
   * while within a function for proof). So, define the range for delimiters to include the
   * character on one end but stop at the newline boundary at the other end. This is to handle the
   * difference between 'i' and 'a' for delimited text objects.
   */
  public TextRange leftDelimiter(int offset, EditorAdaptor editorAdaptor, int count)
      throws CommandExecutionException {
    Position left = leftMotion.destination(offset, editorAdaptor, count);

    Position leftDelim =
        VimUtils.fixLeftDelimiter(
            editorAdaptor.getModelContent(), editorAdaptor.getCursorService(), left);

    return new StartEndTextRange(left, leftDelim);
  }