block command
Use the block command to set the block selection or manipulate the text that is currently selected.
Syntax
block { clear | copy | delete | fill chars | find [end] | lowerCase | move | overlay [transparent] | set [stream | character | element | rectangle] | shift [left | right] [count] | upperCase }
Parameters
You must specify at least one of the parameters to the block command.
clear Use the clear parameter to remove the current block selection. copy Use the copy parameter to copy the currently selected text to the current cursor position. After the copy has completed, the new text will be selected. delete Use the delete parameter to delete the currently selected text from the document. fill chars Use the fill parameter to replace all of the characters that are currently contained within the block selection with the character or characters chars. find [end] Use the find parameter to move the cursor to the beginning of the block selection. If you specify the optional end parameter, the cursor will be moved to the end of the block selection. lowerCase Use the lowerCase parameter to change the selected text to lower case. move Use the move parameter to move the selected text to the current cursor position. After the move has completed, the moved text will be selected. overlay [transparent] Use the overlay parameter to overlay the text at the current cursor position with the currently selected text. If you specify the optional transparent parameter, only the spaces will be overlayed by the selected text. set [ stream
| character
| element
| rectangle
]Use the set parameter to set the block selection. A new block selection will be created at the current cursor position if
- there is no block selection
- the block selection is not in the current view
- the specified block type does not match the current type.
If there is no block type specified and there is no block selection in the current view, current.block.defaultType will be used. If there is a block selection in the current view and the specified block type matches the block type of the block selection or there is no specified block type, the current block will be extended to the current cursor position.
shift [left | right] [count] Use the shift parameter to shift the currently selected text. The shift parameter may only be used if the current block type is element or rectangle. Use the optional left and right parameters to indicate the direction that the text should be shifted. If you do not specify either, the text will be shifted to the right. The count parameter may be specified to indicate the number of character positions that the text should be shifted. If you do not specify count, 1 is assumed. upperCase Use the upperCase parameter to change the selected text to upper case.
Status
The status parameter is not affected by this command.
Description
There is only one block selection for the entire editor application instance. If you have a block selection in one document view and you set a block selection in a new document view, the block selection in the first view is cleared. This allows you to perform copy and move operations from one document view to another. There is no ambiguity since there is only one selection.
There are four block selection types: stream, character, element, and rectangle.
- Stream selection allows you to select a stream of characters. The selection is coupled to the cursor. If you move the cursor, the selection is removed. If you make a change while there is a stream selection active, all of the selected text is removed before the change.
- Character selection also allows you to select a stream of characters but the selection is not coupled to the cursor.
- Rectangle selection allows you to select a rectangle of text. The selection is not coupled to the cursor.
- Element selection allows you to select whole elements only. The selection is not coupled to the cursor.
Block operations only affect the visible elements.
Examples
block clear block fill * block lowerCase
Editor commands, actions, and parameters
findText command
block.bottomElement parameter
block.bottomPosition parameter
block.defaultType parameter
block.inView parameter
block.text parameter
block.topElement parameter
block.topPosition parameter
block.type parameterblockCopy action
blockDelete action
blockFill action
blockLowerCase action
blockMarkAll action
blockMarkBottom action
blockMarkCharacter action
blockMarkDown action
blockMarkElement action
blockMarkElementAtMouse action
blockMarkEnd action
blockMarkHome action
blockMarkLeft action
blockMarkNextWord action
blockMarkPageDown action
blockMarkPageLeft action
blockMarkPageRight action
blockMarkPageUp action
blockMarkPrevWord action
blockMarkRectangle action
blockMarkRectangleAtMouse action
blockMarkRight action
blockMarkToMouse action
blockMarkTop action
blockMarkUp action
blockMarkWord action
blockMarkWordAtMouse action
blockMove action
blockOverlay action
blockShiftLeft action
blockShiftRight action
blockUnmark action
blockUpperCase action
filterSelection action
findBlockEnd action
findBlockStart action
findSelection action
Default editor commands