mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-113940 Enter in comment leads to inconsistent caret position
This commit is contained in:
+5
-1
@@ -55,8 +55,12 @@ public class EnterInLineCommentHandler extends EnterHandlerDelegateAdapter {
|
||||
document.insertString(caretOffset, prefix);
|
||||
return Result.Default;
|
||||
} else {
|
||||
int afterPrefix = offset + prefix.length();
|
||||
if (afterPrefix < document.getTextLength() && text.charAt(afterPrefix) != ' ') {
|
||||
document.insertString(afterPrefix, " ");
|
||||
//caretAdvance.set(0);
|
||||
}
|
||||
caretOffsetRef.set(offset);
|
||||
caretAdvance.set(-prefix.length() - 1);
|
||||
}
|
||||
return Result.Default;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user