Examples of moveCaretRelatively()


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

        int endOffset = startOffset + lookupElement.getLookupString().length();
        document.insertString(endOffset, "()");

        if (completionChar == ' ') {
            caretModel.moveCaretRelatively(3, 0, false, false, false);
        } else {
            caretModel.moveCaretRelatively(1, 0, false, false, false);
        }
    }
}
View Full Code Here

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

        document.insertString(endOffset, "()");

        if (completionChar == ' ') {
            caretModel.moveCaretRelatively(3, 0, false, false, false);
        } else {
            caretModel.moveCaretRelatively(1, 0, false, false, false);
        }
    }
}
View Full Code Here

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

                LeafPsiElement leafPsiElement = PsiUtil.lookupLeafAtOffset(insertionContext.getFile(), insertionContext.getTailOffset());
                if (leafPsiElement == null || leafPsiElement.getTextOffset() != caretModel.getOffset()) {
                    if (completionChar == '\t' || completionChar == '\u0000' || completionChar == '\n') {
                        insertionContext.getDocument().insertString(insertionContext.getTailOffset(), " ");
                        caretModel.moveCaretRelatively(1, 0, false, false, false);
                    }
                }
            }
        }
View Full Code Here

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

        editor.getDocument().insertString(offset, endText);

        PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
        CodeStyleManager.getInstance(project).adjustLineIndent(file, TextRange.from(offset, endText.length()));
        CaretModel caretModel = editor.getCaretModel();
        caretModel.moveCaretRelatively(0, 1, false, false, true);
        CodeStyleManager.getInstance(project).adjustLineIndent(file, caretModel.getOffset());
      }
    });
  }
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.