Editing Multiple Selections and Rectangular Selections

The editor pane supports the following behaviors to select and edit content (in addition to single caret selection).

This section uses the terms stream format and rectangular format to distinguish between content copied by using single or multiple carets, and rectangular selection, respectively.

Multiple Carets

You can create multiple carets and select multiple (non-contiguous) ranges in the editor pane, as follows.

To create additional carets

The main caret is the color specified in your user preferences (that is, the Caret component on the Editor sheet of the Preferences dialog) and additional carets are gray, as shown in the following image.

The main caret is the last one that you add.

You can then enter text, paste content, and perform the Undo and Redo actions at each caret at the same time.

To make multiple selections

You can then enter text and perform the Copy, Cut, and Paste actions on selected content at the same time.

Multiple selection copying concatenates the selections in the order in which you made each selection. One instance of the concatenated selections is then pasted in stream format at each caret. Alternatively, if you paste into a rectangular selection, a single instance of the concatenated selections is pasted for each line of the rectangular selection.

Rectangular Selection Virtual Space

Rectangular selection functionality takes into account virtual space in the selected region.

You can create a rectangular selection anywhere within the text in the editor pane. You cannot extend the selection beyond the end of the text.

A rectangular selection overrides any single caret or multiple caret selections you have made in the editor pane.

Create a rectangular selection, by pressing the:

You can then perform the Copy, Cut, and Paste actions.

Pasting Behavior

This section shows examples of how pasting behaves for content selected and copied at single and multiple carets (stream format) or as a rectangular selection (rectangular format).

Stream format pasting examples

The following table lists examples of pasting stream format text (streamTextToBeCopied) into different destinations.

Pasting Destination After Pasting

Single caret

 

Multiple carets

 

Rectangular selection with no content

 

Rectangular selection with content

 

Rectangular format pasting examples

Pasting rectangular format content into a virtual region adheres to the value you have specified for the Use Tabs For Indent check box on the Editor Options sheet of the Preferences dialog.

When you paste rectangular format content into a rectangular selection, the copied content is pasted from the top left position of the rectangular region and the caret is positioned at the end of the first line to ensure that consecutive paste actions align.

The following table lists examples of pasting rectangular format text in to different destinations.

Pasting Destination After Pasting

Rectangular selection is smaller than pasted text

 

Rectangular selection is larger than pasted text

 

Copying content in a rectangular selection copies the entire selected region including whitespace, but ignores virtual space. When you paste the rectangular format content into a rectangular selection, the virtual space is ignored and only text and whitespace is pasted, as shown in the following example.

Copied Region After Pasting

Copied rectangular region includes white space

Virtual space is ignored and only text and whitespace is pasted

Editor Clipboard Notes

The Jade Platform development environment editor clipboard toolbar supports copying and pasting of selected rectangular content in the clipboard buffers C, 1 through 9, or zero (0). The rectangular state of copied content is now retained in the clipboard buffer.

Additional clipboard toolbar items do not support selected rectangular content, which is pasted in stream format.

For details, see "Using the Editor Clipboard Toolbar", earlier in this chapter.