Save full summary on quit regardless of cursor row
__getstate__ emitted an empty entry list whenever the cursor was on the top row (y == 0), so quitting from the top silently discarded all previously calculated results. The guard was intended to rotate the cursor row to the front, but the y == 0 case should simply keep the whole list as-is. Remove the guard so all entries are always persisted.
This commit is contained in:
parent
53474b2bcb
commit
8af627b502
2 changed files with 7 additions and 1 deletions
|
|
@ -101,6 +101,12 @@ class SummaryCursorTest(unittest.TestCase):
|
|||
self._assert_movements([(self.summary.cursor_down, (1, 1)),
|
||||
(self.summary.cursor_down, (2, 2))])
|
||||
|
||||
def test_getstate_preserves_entries_at_top_row(self):
|
||||
state = self.summary.__getstate__()
|
||||
entries = list(state["_old_entries"])
|
||||
self.assertEqual(len(entries), 3)
|
||||
self.assertEqual(sum(len(row) for row in entries), 8)
|
||||
|
||||
|
||||
class SummarySyncWithFilesystemTestCase(unittest.TestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue