Deleting text

The Delete and the Backspace keys are used for the simplest delete operations. They work fully naturally: The character under the cursor can be deleted by pressing the Delete key. This is a so called forward delete. All characters to the right of the cursor are moved one position to the left and the cursor stays at the same place on the screen. Repeated use of this operation deletes more and more characters that used to be to the right of the cursor. A backward delete is executed by pressing the key marked Backspace . This deletes the character that is to the left of the cursor. Afterwards the cursor moves one position to the left and all characters that were on the cursor or to the right of it are moved one position to the left. Repeated use of this key deletes more and more characters that were to the left of the cursor.

When either one of these commands is used and there are no more characters in the current line for it to delete, the end-of-line of either the current line (for the forward delete) or the previous line (for the backward delete) will be removed and two lines will be joined together. Using the backspace inside the range of a tab (the extra space on the screen created by the presence of a tab) or in virtual territory to the right of a line (at least one column past the end of the line) results only in moving the cursor one position to the left. No other action is taken.

If the backspace is used when the cursor is just to the right of a tab character, the tab character is deleted and the cursor may move several columns depending on the tab settings (also the induced spaces are removed). A tab character is also deleted when the delete key is pressed and the cursor is inside the range of the tab and again the cursor and text may jump several columns. When the delete command is given and the cursor is in virtual territory beyond the end of a line, blank characters will be generated to fill the space between the end of the line and the cursor and then the end-of-line is removed. That is, the next line is joined to the current line at the position of the cursor.

The above backspace actions hold when stedi is in the insert mode. In the overstrike mode, the action of the backspace is to overwrite the previous character with a blank. Only at the beginning of a line will it resort to its normal action of deleting the end-of-line and joining the current line with the previous line.

An entire line can be deleted either with the Ctrl-<delete> combination. Ctrl-D deletes all characters to the right of the cursor (including the character under it). This is called `Delete to end of line'.

All the above deletions, with the exception of the `backspace' in the overstrike mode can be undone with the undo key, as long as no other actions have been taken. Sometimes more than one delete can be undone. In that case either consecutive lines were deleted after each other, or character deletes (or delete to end of line) were made in consecutive lines. The details are explained in the chapter on `undo'.