Multiple Selections

Index of All Documentation » Wing Pro Reference Manual » Source Code Editor » Selecting Text »


Wing Pro and Wing Personal support making multiple selections in the editor, which is a powerful way to simultaneously edit two or more parts of your code. For example, all occurrences of a word such as one may be selected and then the o replaced with O to change all of the occurrences to One in a single operation.

Selecting Matching Text

The selection-add-next-occurrence command (Ctrl-D, Command-D on the Mac, and Ctrl-> with the emacs personality) is a convenient way to add selections with matching text. If something is already selected, this command selects the next occurrence of the selected text. If nothing is selected, it will will select the current word.

Whether this search wraps, is case sensitive, or matches only whole words is controlled from the multi-selection toolbar icon or Edit > Multiple Selections menu.

To add the next occurrence while dropping the current one, press Control-Shift-D, Command-Shift-D on the Mac , or Ctrl-Alt-> with the emacs personality.

Multiple matching selections can also be made quickly within a block, indented level, function, method, class, or file by clicking on the multi-selection toolbar icon or using the Edit > Multiple Selections menu.

Once multiple selections have been made, any typing, cursor movement, and clipboard commands will act on all selections simultaneously.

Selecting Arbitrary Text

It is also possible to make an arbitrary set of selections, where the selections do not necessarily contain the same text. This is done by holding the Ctrl and Alt keys down together (or the Command and Option keys on the Mac) while selecting text with the mouse.

Canceling Multiple Selection

When there are multiple selections, the Escape key (or Control-G with the emacs personality) will drop all of the extra selections.

Multiple Selections Window

While there are multiple selections in an editor, a floating selections window is shown to list all of the selections, even those that are not visible on screen. An individual selection may be dropped by clicking the X that appears when the the mouse is moved over its entry in the list. Closing the selections window will drop all of the extra selections.

By default, the selections window always appears when there are multiple selections. Use the Editor > Selection/Caret > Display Selections Popup preference to set the window to always visible or never visible.

The selections window may also be shown and hidden on a case-by-case basis from the multi-selection toolbar icon or Edit > Multiple Selections menu.