@@ -21,6 +21,7 @@ const (
2121 modePanel // a '?'/'!'/'Q' panel is showing
2222 modeVisual // v/V: a visual selection is up and owns the motions
2323 modeFork // 'f' is down, waiting for the direction of the fork jump
24+ modeConfirm // a y/n question owns the keyboard until it is answered
2425 numKeyModes
2526)
2627
@@ -35,11 +36,12 @@ const (
3536 inPanel keyModeSet = 1 << modePanel
3637 inVisual keyModeSet = 1 << modeVisual
3738 inFork keyModeSet = 1 << modeFork
39+ inConfirm keyModeSet = 1 << modeConfirm
3840
3941 // inPager is every mode with the pager up. Note that a transcript-mode
4042 // row is ALSO reachable while a panel is showing: the panel swallows only
4143 // its own keys and every other key wipes it and acts (see dispatch).
42- inPager = inTranscript | inSearchBox | inJumpBox | inPanel | inVisual | inFork
44+ inPager = inTranscript | inSearchBox | inJumpBox | inPanel | inVisual | inFork | inConfirm
4345 inAnyBox = inIncipit | inPager
4446)
4547
@@ -288,6 +290,18 @@ var keymap = []keyBinding{
288290 help : helpNone , pager : pagerForkCancel ,
289291 },
290292
293+ // -- confirm mode: a destructive verb asks first ------------------------
294+ //
295+ // THE QUESTION OWNS THE KEYBOARD. Every key that is not an answer is
296+ // swallowed (see dispatch), because a stray letter must not be read as
297+ // consent, and the notice stays on the bar for exactly as long as the
298+ // question is up.
299+ {chord : byteChord ('y' ), modes : inConfirm , open : staysInline , why : "only reachable with a question up" , help : helpConfirm , pager : confirmYes },
300+ {chord : byteChord ('Y' ), modes : inConfirm , open : staysInline , why : "only reachable with a question up" , help : helpNone , pager : confirmYes },
301+ {chord : byteChord ('n' ), modes : inConfirm , open : staysInline , why : "only reachable with a question up" , help : helpNone , pager : confirmNo },
302+ {chord : byteChord ('N' ), modes : inConfirm , open : staysInline , why : "only reachable with a question up" , help : helpNone , pager : confirmNo },
303+ {chord : byteChord (0x1b ), modes : inConfirm , open : staysInline , why : "only reachable with a question up" , help : helpNone , pager : confirmNo },
304+
291305 // -- pager level: attending what is on screen --------------------------
292306 //
293307 // 'a' is ATTEND, one verb with two subjects: in the transcript it is the
@@ -389,7 +403,9 @@ var keymap = []keyBinding{
389403 // destructive one, and the two must not be neighbours. What it drops is
390404 // printed into the pager's notice and reprinted to the shell on the way
391405 // out, so a slip costs you the queue's PLACE, not its text.
392- chord : byteChord ('X' ), modes : inTranscript | inPanel | inVisual ,
406+ // NOT IN A PIT: there 'X' is the unasked drop of the selected row
407+ // (below), because a reader inside a list means the list.
408+ chord : byteChord ('X' ), modes : inTranscript | inVisual ,
393409 open : staysInline , why : "it addresses a turn that is streaming in the view you are already in" ,
394410 help : helpHangUpDrop , input : inputHangUpDrop ,
395411 },
@@ -405,6 +421,11 @@ var keymap = []keyBinding{
405421 open : staysInline , why : "it acts on a row in a pit that is already open" ,
406422 help : helpPitDrop , pager : pagerPitDrop ,
407423 },
424+ {
425+ chord : byteChord ('X' ), modes : inPanel ,
426+ open : staysInline , why : "it acts on a row in a pit that is already open" ,
427+ help : helpPitDrop , pager : pagerPitDropNow ,
428+ },
408429
409430 // -- pager level: selection --------------------------------------------
410431 {chord : byteChord (0x0e ), modes : inTranscript , open : opensPager , help : helpSelect , pager : pagerSelectNext },
@@ -725,6 +746,7 @@ const (
725746 helpQueuedPanel
726747 helpHelpPanel
727748 helpListPit
749+ helpConfirm
728750 helpCmdHistory
729751 helpCmdComplete
730752 helpCmdEdit
@@ -777,7 +799,7 @@ var helpRows = []helpRow{
777799 // shell user needs, which is that their fingers already know this box.
778800 {helpCmdEdit , "(in :) ^A ^E ^W ^K ^Y" , "emacs/readline editing, the whole set" },
779801 {helpCmdAbort , "(in :) Esc / ^C / ^G" , "abandon the line, close the box" },
780- {helpPitDrop , "(in a list) x" , "drop the selected entry (queue) " },
802+ {helpPitDrop , "(in a list) x / X " , "drop or kill the selected row, asking first / at once " },
781803 {helpYank , "y" , "copy selection (or aria id if none)" },
782804 {helpVerbose , "M-m" , "toggle verbose tool output and the node addresses" },
783805 {helpSticky , "s" , "pin the question of the turn you are inside" },
@@ -803,6 +825,7 @@ var helpRows = []helpRow{
803825 {helpFormPit , "S" , "the form (state) in the pit" },
804826 {helpFocus , "T" , "read the conversation without closing the pit (again to go back)" },
805827 {helpListPit , "l / L" , "list this aria's tree / the home tree, in the pit (Enter attends, x kills)" },
828+ {helpConfirm , "y / n" , "answer a confirmation (Esc is no); X on a row kills with no question" },
806829 {helpHelpPanel , "h" , "close help" },
807830}
808831
0 commit comments