mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CommentTracker#deleteAndRestoreComments: stop at file level
This commit is contained in:
+1
-1
@@ -111,7 +111,7 @@ public class CommentTracker {
|
||||
public void deleteAndRestoreComments(@NotNull PsiElement element) {
|
||||
grabCommentsOnDelete(element);
|
||||
PsiElement anchor = element;
|
||||
while (anchor.getParent() != null && anchor.getParent().getFirstChild() == anchor) {
|
||||
while (anchor.getParent() != null && !(anchor.getParent() instanceof PsiFile) && anchor.getParent().getFirstChild() == anchor) {
|
||||
anchor = anchor.getParent();
|
||||
}
|
||||
insertCommentsBefore(anchor);
|
||||
|
||||
Reference in New Issue
Block a user