do not remove favorites on every move
[idea/community.git] / lang-impl / src / com / intellij / ide / favoritesTreeView / FavoritesManager.java
index 16aa2d97009e6da02735beb01ed7ee4bbc9adf0f..be7edc96d5b78d35012fe2315ee516f9be815975 100644 (file)
@@ -380,8 +380,11 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable {
             if (element == child && childUrl != null) {
               newRoots.add(Pair.create(childUrl, root.second));
             }
-            else if (element == oldParent) {
-              newRoots.add(Pair.create(root.first.createUrlByElement(newParent), root.second));
+            else {
+              if (element == oldParent) {
+                newRoots.add(Pair.create(root.first.createUrlByElement(newParent), root.second));
+              }
+              newRoots.add(root);
             }
           }
           myName2FavoritesRoots.put(listName, newRoots);