OC-3672 Comment line doesn't move cursor on the next line if it is located next to a argument placeholder

This commit is contained in:
Maxim Shafirov
2012-04-18 13:22:19 +04:00
parent 0ea24b855d
commit 44f831119a
2 changed files with 10 additions and 1 deletions
@@ -97,6 +97,12 @@ public class CommentByLineCommentHandler implements CodeInsightActionHandler {
myStartOffset = selectionModel.getSelectionStart();
myEndOffset = selectionModel.getSelectionEnd();
FoldRegion fold = myEditor.getFoldingModel().getCollapsedRegionAtOffset(myStartOffset);
if (fold != null && fold.shouldNeverExpand() && fold.getStartOffset() == myStartOffset && fold.getEndOffset() == myEndOffset) {
// Foldings that never expand are automatically selected, so the fact it is selected must not interfer with commenter's logic
hasSelection = false;
}
if (myDocument.getTextLength() == 0) return;
while (true) {
@@ -648,4 +654,4 @@ public class CommentByLineCommentHandler implements CodeInsightActionHandler {
}
}
}
}
}
@@ -196,6 +196,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener,
for (CaretListener listener : myCaretListeners) {
listener.caretPositionChanged(event);
}
EditorActionUtil.selectNonexpandableFold(myEditor);
}
}
@@ -237,6 +238,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener,
for (CaretListener listener : myCaretListeners) {
listener.caretPositionChanged(event);
}
EditorActionUtil.selectNonexpandableFold(myEditor);
}
}
@@ -593,6 +595,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener,
listener.caretPositionChanged(event);
}
}
EditorActionUtil.selectNonexpandableFold(myEditor);
}
return null;
}