mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't add extra space to line comment prefix if it's there already
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ public class EnterInLineCommentHandler extends EnterHandlerDelegateAdapter {
|
||||
String prefix = commenter.getLineCommentPrefix();
|
||||
assert prefix != null: "Line Comment type is set but Line Comment Prefix is null!";
|
||||
if (!StringUtil.startsWith(text, offset, prefix)) {
|
||||
if (text.charAt(caretOffset) != ' ') {
|
||||
if (text.charAt(caretOffset) != ' ' && !prefix.endsWith(" ")) {
|
||||
prefix += " ";
|
||||
}
|
||||
document.insertString(caretOffset, prefix);
|
||||
|
||||
Reference in New Issue
Block a user