6.1.11. Smart Home Key

When first pressed on a given line, the Smart Home key will place the cursor on the column containing the first non-blank character of that line. Subsequent presses will cause the cursor to toggle back and forth between column 1 and the column of the first non-blank character.

In the following figure, the cursor is in the middle of a line of Ada source code:

smart home key cursor in middle of line

If you press the Smart Home key, the cursor moves to the column of the first non-blank character on that line:

smart home key cursor on first non-blank

If you press the Smart Home key again, the cursor moves to column 1 of that line:

smart home key cursor on column 1

If you press the Smart Home key yet again, the cursor moves back to the column of the first non-blank column:

smart home key cursor on first non-blank

All subsequent presses on the same line will continue to toggle back and forth.

6.1.12. Smart End Key

The Smart End key works in a manner analogous to the Smart Home key, with the obvious difference that it works with the end of the line instead of the beginning. Another difference is that there may not be any characters after the last non-blank character, in which case the cursor will remain on the column of the last non-blank for subsequent presses of the key on that line.

Note that the “Remove trailing spaces when saving” preference on the Editor preference page will remove trailing spaces when an Ada source file is saved.

If there are whitespace characters after the last non-blank character on the line, the Smart Home key will toggle back and forth between the last of them and the last non-blank, as illustrated in the figures below.

In this first figure, the Smart End key has been pressed and therefore the cursor is on the last non-blank character:

smart home key cursor on last non-blank

There is whitespace after that column in this example, so pressing the Smart End key again moves the cursor to the last of them:

smart home key cursor on last blank

Pressing the Smart Home key again moves the cursor back to the last non-blank character:

smart home key cursor on last non-blank

All subsequent presses on the same line will continue to toggle back and forth in that manner.