42. insertNewlineOrSplitBlock
Prev | Chapter 6. Commands written in the Java™ programming language | Next

## 42. insertNewlineOrSplitBlock

No parameter.

If the caret is contained in a element which accepts newline characters (e.g. `pre`, `programlisting`), a newline character (`&`0#xA;``) is inserted in this element. Otherwise, if the caret is contained in a block, this block is split in two parts.

To make it simple, a block is a paragraph or a list item. However what is exactly a block must be specified as explained in Section 46.1, “Specifying splittable blocks”.

More precisely, if the caret is found at the very beginning of a block, a new, similar, empty block is inserted before the current one. If the caret is found at the very end of a block, a new, similar, empty block is inserted after the current one. Otherwise, the current block is split in two parts.

When acting on the current block, this command can be executed if there is no selection or if a single element is explicitly selected. When there is no selection, the current block is automatically determined among the elements which directly or indirectly contain the caret. When an element is selected, this element is considered to be the current block if and only if it directly or indirectly contains the caret and it is listed in the ``configuration_name` blockList` property.

This command is intended to be bound to the Enter key.

Prev | Up | Next
41. insertControlChar | Home | 43. insertNode