From: Armaan Bhojwani Date: Mon, 1 Feb 2021 15:17:33 +0000 (-0500) Subject: Set index to 0 before saving if at end of set X-Git-Tag: v0.5.0~8 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=d509c1b8a05e7ac88b19558fa2a7b2a04e5d04f4 Set index to 0 before saving if at end of set --- diff --git a/lightcards/display.py b/lightcards/display.py index 2fc7058..b4076e5 100644 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -24,6 +24,9 @@ class Display(): self.get_key() def leave(self): + if self.obj.getIdx() == len(self.stack): + self.obj.setIdx(0) + progress.dump((self.obj, self.stack, self.headers), self.stack) sys.exit(0)