anchor.diff:    void _reloadData() {
       _clearChildrenCache();
       _treeView.reloadData();
  +  }
  +
  +  // This method will be more efficient than _reloadData() then restoring the
  +  // state.
  +  void _reloadDataAndRestoreExpandedState(List<String> expandedState) {
  +    List<String> selection = _treeView.selection;
  +    for(String nodeUid in selection) {
  +      Resource res = _filesMap[nodeUid];
  +      List<Container> parents = _collectParents(res, []);
  +      List<String> parentsUuid =
  +          parents.map((Container container) => container.uuid).toList();
  +      expandedState.addAll(parentsUuid);
  +    }
  +
  +    _clearChildrenCache();
  +    _treeView.restoreExpandedState(expandedState);
  +    // Restore selection.
  +    _treeView.selection = selection;
     }
   
     // Processing workspace events.
  
positive.code:   }
  
    void treeViewSaveExpandedState(TreeView view) {
      localPrefs.setValue('FilesExpandedState',
          JSON.encode(_treeView.expandedState));
    }
  
negative.code:         });
        });
  
        _reloadDataAndRestoreExpandedState(filtered.toList());
      }
    }
  }
  