do not remove favorites on every move
authorAnna Kozlova <Anna.Kozlova@jetbrains.com>
Thu, 15 Jan 2009 14:16:32 +0000 (17:16 +0300)
committerAnna Kozlova <Anna.Kozlova@jetbrains.com>
Thu, 15 Jan 2009 14:16:32 +0000 (17:16 +0300)
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);