]> git.armaanb.net Git - lightcards.git/blobdiff - lightcards/display.py
Add keybinding to open file in editor
[lightcards.git] / lightcards / display.py
index 8e7bba405a4ed3b404bdbd2be88b472529276f51..fd11158b789eccac7c0902aca69811e915b68af4 100755 (executable)
@@ -6,6 +6,8 @@ from random import shuffle
 import sys
 import textwrap
 
+from . import lightcards
+
 
 def disp_bar(stdscr, stack, headers, obj):
     """
@@ -156,7 +158,8 @@ def disp_help(stdscr, stack, headers, idx):
                   "i, /               star card\n" +
                   "0, ^, home         go to the start of the deck\n" +
                   "$, end             go to the end of the deck\n" +
-                  "H, ?               open this screen\n\n" +
+                  "H, ?               open this screen\n" +
+                  "e                  open the input file in $EDITOR\n\n" +
                   "More information can be found in the man page, or by\n" +
                   "running `lightcards --help`.\n\n" +
                   "Press [q], [H], or [?] to go back.")
@@ -210,3 +213,6 @@ def get_key(stdscr, stack, headers, idx):
             disp_card(stdscr, stack, headers, idx)
         elif key in ["H", "?"]:
             disp_help(stdscr, stack, headers, idx)
+        elif key == "e":
+            (headers, stack) = lightcards.reparse()
+            get_key(stdscr, stack, headers, idx)