Undo Command [UN]

Qedit 5.7 for HP-UX

Home Previous Next


Undo Command [UN]

Reverses the effect of the previous command that modified text, after showing you the command and asking your permission.

UNDO [ ALL | REDO ]

(Default: the last editing task)

Undo prints the command to be undone and how many lines it actually updated, added, deleted, and/or renumbered. The commands can only be undone in reverse order, one at a time, and no commands can be skipped. Therefore, you don't have to specify which command to Undo; you are always presented with the next one, then asked if you want to actually undo it.

If you want to see the commands in the Undo Stack, use the Listundo command.

After an Undo, another Undo will cancel the command that was one further back. In this way, you can Undo back to the time the file was first Texted or Opened. If you Undo one step too far, you can cancel your preceding Undo task using the Undo Redo command. This option is accepted until there are no more Undo tasks to be cancelled. Once you enter a non-Undo edit command, you have approved your Undo tasks and they can no longer be cancelled.

Or, you can use Undo All to undo all the updates since the last Text or Open. If you don't like the results after an Undo All, you can put the file back in the edited state by doing another Undo (i.e., you can Undo the Undo All).

Examples

/cq "Bob"Robret" all  {mistake in Change}
23 lines changed
/undo                 {reverse Change command}
Command to Undo:  CQ "Bob"Robret" all
   ( Update:8 )       {shows actual update counts}

Undoing Changes in Visual Mode

You can use the Undo command to cancel changes in Visual mode as well as in Line mode. All of the changes you make on the screen before pressing Enter are treated by Qedit as one "undo-able" command, except for cut-and-paste operations. Qedit always executes your cut-and-paste operation last after updating the file with any other changes, no matter what order the changes were made in. This means that you can choose to undo just the cut-and-paste operation, or undo it and all of the other changes. You can continue undoing your previous changes from each Enter, one at a time, until your file is back to its original state.

Notes

An Undo cannot be undone, except by Undo All.

The Undo change log is reset by a Text command (but not a Keep), by a Delete All, or by shutting the file. The Undo log is temporary and is not retained if you exit Qedit or log off the system. You cannot go back and undo changes that you made to a file after you leave Qedit.

You can Undo any text-altering commands since the last Text or Open command, except for Delete All. Delete All can be canceled before the next command line is executed using Control-Y.

In the unlikely event that the undo log file (i.e., "undolog") overflows, Qedit will print a warning message and disable the Undo feature. Undo is disabled in batch by default, and active in session usage. Using the Set Undo command you may override this default or disable Undo for a particularly large edit, to save overhead.

/set undo on
/set undo off


Home Previous Next