mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-65108 Inserting line break in text file can cause incorrect formatting and cursor placement on new line if the original line starts with an asterisk
Javadoc-like processing is corrected for plain text files
This commit is contained in:
@@ -259,8 +259,8 @@ public class EnterHandler extends BaseEnterHandler {
|
||||
final PsiElement parent = element.getParent();
|
||||
|
||||
if (text.equals(commentContext.commenter.getDocumentationCommentPrefix()) && isDocComment(parent, commentContext.commenter) ||
|
||||
text.startsWith(commentContext.commenter.getDocumentationCommentPrefix()) && element instanceof PsiComment
|
||||
) {
|
||||
text.startsWith(commentContext.commenter.getDocumentationCommentPrefix()) && element instanceof PsiComment)
|
||||
{
|
||||
PsiComment comment = isDocComment(parent, commentContext.commenter) ? (PsiComment)parent:(PsiComment)element;
|
||||
int commentEnd = comment.getTextRange().getEndOffset();
|
||||
|
||||
@@ -321,7 +321,7 @@ public class EnterHandler extends BaseEnterHandler {
|
||||
|
||||
String indentInsideJavadoc = null;
|
||||
int line = myDocument.getLineNumber(myOffset);
|
||||
if (line > 0) {
|
||||
if (line > 0 && (commentContext.docAsterisk || commentContext.docStart)) {
|
||||
indentInsideJavadoc = CodeDocumentationUtil.getIndentInsideJavadoc(myDocument, myDocument.getLineStartOffset(line - 1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user