Changes according IDEA-CR-8085 comments

This commit is contained in:
Rustam Vishnyakov
2016-02-01 12:58:39 +03:00
parent 79f1bd5de3
commit 17c5a76989
3 changed files with 7 additions and 7 deletions
@@ -218,7 +218,7 @@
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/ApplicationBundle" key="checkbox.line.comment.prepend.with.space"/>
<text resource-bundle="messages/ApplicationBundle" key="checkbox.line.comment.add.space"/>
</properties>
</component>
</children>
@@ -222,7 +222,7 @@ public class CommentByLineCommentHandler extends MultiCaretCodeInsightActionHand
if (!block.skip) {
if (!allLinesCommented) {
if (!block.commentWithIndent) {
doDefaultCommenting(block, block.addSpace);
doDefaultCommenting(block);
}
else {
doIndentCommenting(block);
@@ -433,7 +433,7 @@ public class CommentByLineCommentHandler extends MultiCaretCodeInsightActionHand
return CharArrayUtil.regionMatches(chars, offset, prefix) ? offset : -1;
}
public void doDefaultCommenting(final Block block, final boolean addSpace) {
public void doDefaultCommenting(final Block block) {
final Document document = block.editor.getDocument();
DocumentUtil.executeInBulk(
document, block.endLine - block.startLine >= Registry.intValue("comment.by.line.bulk.lines.trigger"), new Runnable() {
@@ -441,7 +441,7 @@ public class CommentByLineCommentHandler extends MultiCaretCodeInsightActionHand
public void run() {
for (int line = block.endLine; line >= block.startLine; line--) {
int offset = document.getLineStartOffset(line);
commentLine(block, line, offset, addSpace);
commentLine(block, line, offset);
}
}
});
@@ -475,7 +475,7 @@ public class CommentByLineCommentHandler extends MultiCaretCodeInsightActionHand
buffer.append(c);
offset++;
}
commentLine(block, line, offset, false);
commentLine(block, line, offset);
}
}
});
@@ -597,7 +597,7 @@ public class CommentByLineCommentHandler extends MultiCaretCodeInsightActionHand
return false;
}
private static void commentLine(Block block, int line, int offset, boolean addSpace) {
private static void commentLine(Block block, int line, int offset) {
Commenter commenter = block.blockSuitableCommenter;
Document document = block.editor.getDocument();
if (commenter == null) commenter = findCommenter(block.editor, block.psiFile, line);
@@ -733,4 +733,4 @@ code.style.other.label=Text files and unsupported file types\:
remote.desktop.detected.title=Remote desktop detected
remote.desktop.detected.message=Animation disabled
checkbox.line.comment.prepend.with.space=Prepend with space
checkbox.line.comment.add.space=Add a space at comment start