Trim undo list down to at most nc commands. Call this periodically to prevent the undo-list from growing beyond a certain number of records.