undo command

Use the undo command to undo or redo changes in the current document.  You can also use this command to explicitly close off the current change, clear all changes from the undo stack, or reset the changes count to zero.

 

 

Syntax

undo [ [ n ] [ discard ] [ quiet ]
     | check
     | clear
     | resetChanges
     ] 

 

Parameters

n Use the n parameter to indicate the number of changes that should be undone.  If n is negative, -n changes will be redone.
discard Use the discard parameter to discard any changes that are undone so that they cannot be redone.  If n is negative, the discard parameter is not allowed.
quiet Use the quiet parameter to suppress any messages that are produced by the undo command.
check Use the check parameter to close off the current change.
clear Use the clear parameter to remove all of the changes from the undo stack.
resetChanges Use the resetChanges parameter to reset the changes count to zero.

 

Status

The status parameter is not affected by this command.

 

Description

If no parameters are specified, the undo command will undo one change.

The dirty parameter may be used to determine whether there is an incomplete change.  If there is no incomplete change, undo check will not do anything.  If there is an incomplete change, undo check will complete the change, increment the changes count and reset the dirty parameter to off.

Only complete changes can be undone.

Changes are implicitly completed when the cursor is moved off the current line.  If the autoCheck parameter is set to off, changes are not implicitly completed.

Changes made while recording is off cannot be undone.

Changes made which only affect show elements are not recorded and cannot be undone.

 

Examples

undo
undo -1
undo clear 

Related concepts
Editor commands, actions, and parameters

Related reference
load command
save command
autoCheck parameter
changes parameter
dirty parameter
recording parameter
redo action
undo action
Default editor commands