@Override
	public synchronized void undo() throws CannotUndoException {
		if (!canUndo())
			return;
		AbstractDocument.DefaultDocumentEvent lastUndo = null;
		AbstractDocument.DefaultDocumentEvent nextUndo = null;
		UndoableEdit ue;
		while((ue = super.editToBeUndone()) != null) {
			if (!canUndo()) {
				break;
			}
			if (ue instanceof AbstractDocument.DefaultDocumentEvent) {
				nextUndo = (AbstractDocument.DefaultDocumentEvent)ue;
				if (lastUndo == null || lastUndo.getPresentationName().equals(nextUndo.getPresentationName())) {
					boolean breakFlag = false;
					if (lastUndo != null) {
						breakFlag = (Math.abs(nextUndo.getOffset() - lastUndo.getOffset()) > 1);
					}
					if (breakFlag) {
						break;
					} else {
						super.undo();
						lastUndo = nextUndo;
					}
				} else {
					break;
				}
			} else {
				// あり得ない
				throw new RuntimeException();
				//super.undo();
				//break;
			}
		}
	}