mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
+7
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user