Slick EDIT V3.3 User Manual
Page 191

• surround_with - This command is used to display the Surround With dialog, allowing you to pick a
structure to surround selected text with. This command can be bound to a key—see
for more information.
• sur_text - This is a Slick-C
®
function that can only be used inside of a Surround With template. It is
used to indicate where the selected text should be placed and can be used multiple times within a
single Surround With template. sur_text can take several parameters, which can appear in any order.
The available parameters are:
• -beautify - This is the default for C, Java, and others. It beautifies the results of the template expan-
sion.
• -begin
• -deselect - This is the default parameter. It specifies to leave the text deselected.
• -end
• -ignore
the beginning of the selected line.
• -indent - Indents each line of the selection.
• -nobeautify - This is the default for HTML, XML, and others. It specifies that the editor should not at-
tempt to beautify the results of the template expansion.
• -notext - Specifies that no text should be pasted.
• -select - Leaves the text selected.
• -stripbegin
plied before -begin.
• -stripend
before -end.
• surround_with_if - This is a wrapper command that expands the if template for the selected text. This
command can be bound to a key—see
for more information.
The use of Surround With can be streamlined by using wrapper commands and key bindings. You can
create your own wrapper commands. The following example is the definition of surround_with_if
_command void surround_with_if() name_info(',':
VSARG2_REQUIRES_EDITORCTL | VSARG2_MARK | VSARG2_REQUIRES_AB_SELECTION)
{
surround_with('if');
}
You must change the name of the command and the argument passed to surround_with. The argument
does not have to be an exact match with the template name. For instance, calling surround_with('i') will
prompt you to select the if, if...else, or include once template. If there is an exact match, that template
Surround With
169