code: function(sender, evt)
  	{
  		var cand = graph.getSelectionCellsForChanges(evt.getProperty('edit').changes);
  		var model = graph.getModel();
  		var cells = [];
  		
  		for (var i = 0; i < cand.length; i++)
  		{
  			if ((model.isVertex(cand[i]) || model.isEdge(cand[i])) && graph.view.getState(cand[i]) != null)
  			{
  				cells.push(cand[i]);
  			}
  		}
  		
  		graph.setSelectionCells(cells);
  	}
docs: Keeps the selection in sync with the history