The editor and console in CodeRunner support multiple selections. This is useful when you need to make similar edits in more than one location simultaneously in a document.
Normally when clicking or dragging, the current selection is moved to the new location, thereby maintaining a single selection. To instead toggle multiple selections, hold ⌃⇧ or ⌘ or ⌥ while clicking or dragging.
When holding ⌥ and dragging the mouse, a rectangular block of text is selected across multiple lines.
As a general rule, keyboard shortcuts involving multiple selections use the modifier keys ⌃⇧.
To select multiple occurrences of the selected string, use
. This will set the find search string and thereby highlight all occurrences of the string in the document. The selected occurrences are highlighted in yellow. To iteratively add the next highlighted occurrence to the selection, you can repeatedly invoke . To add the previous highlighted occurrence to the selection, or deselect (skip) the latest one, use .To quickly select all occurrences of the selected string in the document, use
. Usually, the selected occurrences are highlighted in yellow. This means that a regular string search was performed. However, if the selected string refers to a code token, such as a variable or function name, all instances of this token are selected and highlighted in blue. This means that other occurrences of the string that do not refer to the same token are not highlighted. To instead highlight all literal occurrences of the selected text, repeat the command .When you are done using multiple selections and want to return to the normal single selection mode, simply press ⎋ or use . If you normally use ⎋ to invoke code completion and multiple selections are set, you can invoke code completion using ⌃␣ or ⌥⎋.
Use
to jump to the current selection in the document. When multiple selections are set, use this key combination multiple times to iteratively jump to the next selection. Use to jump to the previous selection. These key combinations are useful to quickly identify all the active selections in a document.