Examples of moveToOffset()


Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

        return true;
      }
      if (atCaret instanceof PsiFile || atCaret instanceof CompoundExpression) {
        return false;
      } else {
        caretModel.moveToOffset(atCaret.getTextOffset() + atCaret.getTextLength());
        return true;
      }
    }
  }
}
View Full Code Here

Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

            new WriteCommandAction(project) {
                @Override
                protected void run(Result result) throws Throwable {
                    console.setInputText(newText);
                    caretModel.moveToOffset(offset + indent + 1);
                }
            }.execute();

            return;
        }
View Full Code Here

Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

        LanguageConsoleImpl languageConsole = processHandler.getLanguageConsole();
        languageConsole.setInputText(command);

        Editor editor = languageConsole.getCurrentEditor();
        CaretModel caretModel = editor.getCaretModel();
        caretModel.moveToOffset(command.length());

        HaskellConsole console = (HaskellConsole) languageConsole;
        HaskellConsoleExecuteActionHandler handler = console.getExecuteHandler();

        handler.runExecuteAction(console, true);
View Full Code Here

Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

          if (hasSelection) {
            long selectionStart = selectionModel.getSelectionStart();
            long selectionEnd = selectionModel.getSelectionEnd();
            long length = s.length();
            caretModel.moveToOffset((int) (offset));
            selectionModel.setSelection((int) (selectionStart -length), (int) (selectionEnd -length));
            editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
          } else {
            selectionModel.removeSelection();
            caretModel.moveToLogicalPosition(new LogicalPosition(line, column));
View Full Code Here

Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

          if (hasSelection) {
            long selectionStart = selectionModel.getSelectionStart();
            long selectionEnd = selectionModel.getSelectionEnd();
            long length = s.length();
            caretModel.moveToOffset((int) (offset+length));
            selectionModel.setSelection((int) (selectionStart + length), (int) (selectionEnd + length));
            editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);
          } else {
            selectionModel.removeSelection();
            caretModel.moveToLogicalPosition(new LogicalPosition(line + 1, column));
View Full Code Here

Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

  }

  protected static int moveCaret(final Editor editor, final int tailOffset, final int delta) {
    final CaretModel model = editor.getCaretModel();
    if (model.getOffset() == tailOffset) {
      model.moveToOffset(tailOffset + delta);
    }
    return tailOffset + delta;
  }

  public static final TailType UNKNOWN = new TailType(){
View Full Code Here

Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

    boolean needNewline = !(lastChild instanceof PsiWhiteSpace && StringUtil.countNewLines(lastChild.getText()) > 0);

    CaretModel caretModel = editor.getCaretModel();
    ErlangFunction function = PsiTreeUtil.getParentOfType(psiFile.findElementAt(caretModel.getOffset()), ErlangFunction.class);
    String name = function != null ? function.getName() : "name";
    caretModel.moveToOffset(endOffset);
    insertTestFunction(project, editor, name, needNewline);
  }

  @Override
  public boolean startInWriteAction() {
View Full Code Here

Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

            new WriteCommandAction(JavaREPLConsoleExecuteActionHandler.this.project) {
                @Override
                protected void run(Result result) throws Throwable {
                    console.setInputText(newText);
                    caretModel.moveToOffset(offset + indent + 1);
                }
            }.execute();

            return;
        }
View Full Code Here

Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

      new WriteCommandAction(myProject) {
        @Override
        protected void run(Result result) throws Throwable {
          console.setInputText(newText);
          caretModel.moveToOffset(offset + indent + 1);
        }
      }.execute();

      return;
    }
View Full Code Here

Examples of com.intellij.openapi.editor.CaretModel.moveToOffset()

    final LanguageConsoleImpl languageConsole = processHandler.getLanguageConsole();
    languageConsole.setInputText(command);

    final Editor editor = languageConsole.getCurrentEditor();
    final CaretModel caretModel = editor.getCaretModel();
    caretModel.moveToOffset(command.length());


    LOG.assertTrue(languageConsole instanceof ClojureConsole);

    final ClojureConsole console = (ClojureConsole) languageConsole;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.