Automatically surround selections

In SQL Editor, dbForge Query Builder for MySQL automatically surrounds selected text with matching characters. When you select part of the text and type an opening character, the corresponding closing character is inserted around the selection. This behavior is controlled by the Automatically surround selections feature.

Supported surround characters

The supported surround characters are: ( ), [ ], { }, < >, " ", ' ', and ` `.

Turn off Automatically surround selections

By default, the Automatically surround selections feature is enabled. To turn it off:

1. In the top menu, select Tools > Options.

2. Navigate to Text Editor > General and clear Automatically surround selections when typing quotes or brackets.

3. Click OK to save the changes.

Surround the selected text

To wrap the text in a pair of matching characters, select the text and start typing the opening character.

Surround behavior

  • Pressing the trigger character again applies another level of wrapping inside the existing pair.
  • Pressing Esc removes the selection. The wrapping remains.
  • Pressing Ctrl+Z removes the surrounding characters and replaces the selected text with the opening character of the pair. Pressing Ctrl+Z again restores the original selection.
  • For the pairs ( ), [ ], { }, and < >, pressing the closing character immediately after the opening character removes the selection. After that, pressing Ctrl+Z removes the closing character and replaces the selected text with the opening character.
  • Pressing an unsupported surround character replaces the selected text with that character.
  • When you select multiple lines by using Alt+Shift+Arrow keys, then type (, each selected line is wrapped individually, and the selection is preserved.

Note

When both the Automatically surround selections and List Members features are enabled, pressing ( inserts the selected identifier from the completion list, by replacing the selected text, and adds the opening parenthesis. The cursor is placed immediately after the inserted parenthesis.