The code below, which maintains a set containing the coordinates of currently selected cells, works most of the time. But, after editing a cell by double-clicking, `previous.indexes` is missing the coordinates of the cell that was just edited. As a result, errors in `self.final.selection` build up over time. Is there any way to prevent this from happening?

```
def selectionChanged(self, current, previous):
"""
The names `current` and `previous` are misleading. `previous` provides information about
cells that were deselected since the last invocation. `current` provides information
about cells that were just selected.
"""

self.final.previous= []
self.final.current = []

for index in previous.indexes():
r= index.row()
c= self.model.column_map[index.column()]

self.final.previous .append ((r, c))
self.final.selection.discard((r, c))

for index in current.indexes():
r= index.row()
c= self.model.column_map[index.column()]

self.final.current .append ((r, c))
self.final.selection.add ((r, c))

self.update_sig.emit(self)

# If the application provided a callback function, invoke it:
if self.selection_changed:
self.selection_changed(self.final.previous, self.final.current, self.final.selection)
```