diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java index 3325c4f1d27c..6a879e9000b2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByBlockCommentHandler.java @@ -151,6 +151,12 @@ public class CommentByBlockCommentHandler implements CodeInsightActionHandler { else if (selectionModel.hasSelection()) { int selectionStart = selectionModel.getSelectionStart(); int selectionEnd = selectionModel.getSelectionEnd(); + if (commenter instanceof IndentedCommenter) { + final Boolean value = ((IndentedCommenter)commenter).forceIndentedLineComment(); + if (value != null && value == Boolean.TRUE) { + selectionStart = myDocument.getLineStartOffset(myDocument.getLineNumber(selectionStart)); + } + } commentRange(selectionStart, selectionEnd, prefix, suffix, commenter); } else {