mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
#RUBY-11649 fixed
This commit is contained in:
+11
@@ -155,6 +155,7 @@ public class CommentByBlockCommentHandler implements CodeInsightActionHandler {
|
||||
final Boolean value = ((IndentedCommenter)commenter).forceIndentedLineComment();
|
||||
if (value != null && value == Boolean.TRUE) {
|
||||
selectionStart = myDocument.getLineStartOffset(myDocument.getLineNumber(selectionStart));
|
||||
selectionEnd = myDocument.getLineEndOffset(myDocument.getLineNumber(selectionEnd));
|
||||
}
|
||||
}
|
||||
commentRange(selectionStart, selectionEnd, prefix, suffix, commenter);
|
||||
@@ -162,6 +163,16 @@ public class CommentByBlockCommentHandler implements CodeInsightActionHandler {
|
||||
else {
|
||||
EditorUtil.fillVirtualSpaceUntilCaret(editor);
|
||||
int caretOffset = myEditor.getCaretModel().getOffset();
|
||||
if (commenter instanceof IndentedCommenter) {
|
||||
final Boolean value = ((IndentedCommenter)commenter).forceIndentedLineComment();
|
||||
if (value != null && value == Boolean.TRUE) {
|
||||
final int lineNumber = myDocument.getLineNumber(caretOffset);
|
||||
final int start = myDocument.getLineStartOffset(lineNumber);
|
||||
final int end = myDocument.getLineEndOffset(lineNumber);
|
||||
commentRange(start, end, prefix, suffix, commenter);
|
||||
return;
|
||||
}
|
||||
}
|
||||
myDocument.insertString(caretOffset, prefix + suffix);
|
||||
myEditor.getCaretModel().moveToOffset(caretOffset + prefix.length());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user