Post by Stefan on Apr 10, 2021 16:38:27 GMT -5
George,
In keeping with WINDOWS convention, I assigned the !UNDO primary command to the CTRL-Z key sequence.
However, unlike RESET, which always takes precedence over line commands, UNDO does not.
This means that UNDO is effectively inoperative when line commands are pending.
I contend that this is illogical. A user issues the UNDO command when they are not happy with how things look following prior ATTN event(s).
Whatever was done by the most recent ATTN event is to be reversed.
So whatever the user may have typed since the most recent ATTN event is also to be sacrificed.
Suggestion 1: UNDO (like RESET) should ignore pending line commands and just 'do its thing' when the UNDO command is issued.
Meanwhile, I note that assigning the following to CTRL-Z gets close to a solution:
(SaveCursor)(PA1)(Home)(EraseEOL)[CZ](Enter)[CZ](Enter)(RestoreCursor)
But it is clunky because
a) it needs 2 UNDO statements, presumably because (PA1) generates an ATTN event and UNDO relates to ATTN events.
(PA1) acts as a toggle. It reverses the current 'buffer' every time (PA1) is executed. So (PA1) is its own 'undo' and UNDO is irrelevant to (PA1)
b) I had to SET ALIAS.cz = UNDO so that the UNDO commands (their length exceeds 2 bytes) do not pollute the RETRIEVE stack
Retrieving UNDO is unnecessary if it is assigned to a key like CTRL-Z
Suggestion 2: UNDO to ignore ATTN events generated by (PA1)
Lastly, depending on user activity, UNDO can often jump the display to a completely different area of the file.
It would be helpful if the cursor were left at the location where it was when the previous ATTN event occurred.
As it stands, in the event that the display is in a different area, the cursor is always on the command line, which can make it hard to remember what was changed on that 'PAGE'.
This would be helpful in determining if I've reached the right point or need to step back further.
Suggestion 3: Write the cursor position at the time of the ATTN event to the UNDO file with the data, so UNDO can show the previous view/page as it was when the ATTN event occurred.