Use prompt-index 1 as the default
John Smith

John Smith commited on 2023-133 17:52:33
Showing 1 changed files, with 5 additions and 0 deletions.


When the user runs a Memoire command which expects an index of the form
`card:prompt`, they may instead just put in `card` and let Memoire
infer `prompt` to be 1. This is especially convenient for the "c"
operation, which does not depend on `prompt` anyway.
... ...
@@ -104,6 +104,11 @@ if action.nd then
104 104
                 if a and b then
105 105
                     -- a and b are valid numbers because they came from a match
106 106
                     ip = { tonumber(a), tonumber(b) }
107
+                else
108
+                    ip = tonumber(arg[2])
109
+                    if ip then
110
+                        ip = { ip, 1 }
111
+                    end
107 112
                 end
108 113
             end
109 114
             if ip then
110 115