mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-25167 - SIOOBE: DocumentImpl.insertString
This commit is contained in:
@@ -339,7 +339,7 @@ public class EnterHandler extends BaseEnterHandler {
|
||||
myOffset = codeStyleManager.adjustLineIndent(myFile, myOffset);
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
|
||||
if (!StringUtil.isEmpty(indentInsideJavadoc)) {
|
||||
if (!StringUtil.isEmpty(indentInsideJavadoc) && myOffset < myDocument.getTextLength()) {
|
||||
myDocument.insertString(myOffset + 1, indentInsideJavadoc);
|
||||
myOffset += indentInsideJavadoc.length();
|
||||
docIndentApplied = true;
|
||||
@@ -347,7 +347,6 @@ public class EnterHandler extends BaseEnterHandler {
|
||||
|
||||
if (myForceIndent && indentInsideJavadoc != null) {
|
||||
int indentSize = CodeStyleSettingsManager.getSettings(myProject).getIndentSize(myFile.getFileType());
|
||||
//TODO den check tabs
|
||||
myDocument.insertString(myOffset + 1, StringUtil.repeatSymbol(' ', indentSize));
|
||||
myCaretAdvance += indentSize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user