gschem: Fix net consolidation (HACK)
Net consolidation was previously triggered at file save time, until
commit
1f05fb8e7b857c2bba2fbcaa4893ecbedcc478a9 removed the call to
o_net_consolidate() from o_save_buffer().
Unfortunately, gschem relied on this call to ensure net consolidation
behaviour worked as expected. When changes were made on the schematic,
o_undo_savestate() was called to save an undo state (to a temporary
file), which eventually called o_save_buffer(), and this caused nets
on in the schematic to be consolidated.
As a kludge to work around this regression, this commit adds a call
to o_net_consolidate() in o_undo_savestate(). This of course, is not
a nice place to put it! This issue should be revisited after 1.6.x
is released, ideally finding a cleaner place to trigger consolidations.
Notes on the problem:
Consolidate nets needs to happen when:
A new net is drawn (and added to the page)
A net end-point is rubber-banded
A net is moved / copied into place
A net sitting perpendicularly between two colinear nets
(preventing them consolidating) is removed (Cut/Move/Delete)
We want the "undo" state saved to be inclusive of the net
consolidation.. therefore it needs to happen _before_ the undo state
is saved, or we would have to cheat, and consolidate again after any
"undo" / "redo" operation.
Since o_undo_savestate() is called after modifications are made to
the page, it provides a useful (but kludgy) place to catch all of
the above cases before the undo state is saved.