function emptyEditorOnDeleteEverything() {
			function isEverythingSelected(editor) {
				var caretWalker = new CaretWalker(editor.getBody());
				var rng = editor.selection.getRng();
				var startCaretPos = CaretPosition.fromRangeStart(rng);
				var endCaretPos = CaretPosition.fromRangeEnd(rng);

				return !editor.selection.isCollapsed() && !caretWalker.prev(startCaretPos) && !caretWalker.next(endCaretPos);
			}

			// Type over case delete and insert this won't cover typeover with a IME but at least it covers the common case
			editor.on('keypress', function (e) {
				if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode > 31 && !VK.metaKeyPressed(e)) {
					if (isEverythingSelected(editor)) {
						e.preventDefault();
						editor.setContent(String.fromCharCode(e.charCode));
						editor.selection.select(editor.getBody(), true);
						editor.selection.collapse(false);
						editor.nodeChanged();
					}
				}
			});

			editor.on('keydown', function (e) {
				var keyCode = e.keyCode;

				if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {
					if (isEverythingSelected(editor)) {
						e.preventDefault();
						editor.setContent('');
						editor.nodeChanged();
					}
				}
			});
		}
Properly empties the editor if all contents is selected and deleted this to
prevent empty paragraphs from being produced at beginning/end of contents.