]> git.armaanb.net Git - lightcards.git/blobdiff - lightcards/display.py
Replace $EDITOR in menu with actual editor
[lightcards.git] / lightcards / display.py
index f93b0fa58921f1aa881e97a11d6d2db1d24cf737..e91fed1a302db23d1626464d44c869df0c0194b9 100644 (file)
@@ -132,6 +132,7 @@ class Menu:
             curses.color_pair(1) + curses.A_BOLD,
         )
         self.win.hline(2, 1, curses.ACS_HLINE, mcols)
+        env = os.environ.get("EDITOR", "$EDITOR")[:15]
         text = [
             "[y]: reset stack to original state",
             "[a]: alphabetize stack",
@@ -140,8 +141,7 @@ class Menu:
             "[u]: unstar all",
             "[d]: star all",
             "[s]: update stack to include starred only",
-            "[e]: open the input file in $EDITOR",
-            "",
+            f"[e]: open the input file in {env}" "",
             "[r]: restart",
             "[m]: close menu",
         ]
@@ -193,6 +193,7 @@ class Menu:
                 shuffle(self.outer.stack)
                 self.menu_print("Stack shuffled!")
             elif key == "e":
+                progress.dump(self.outer.stack, runner.get_orig()[1])
                 curses.endwin()
                 os.system(f"$EDITOR {self.outer.input_file}"),
                 (self.outer.headers, self.outer.stack) = parse.parse_html(