Viewing and Displaying

SlickEdit® Core offers several features and options regarding viewing and displaying. See the following topics for more information:

Colors and Color Coding

SlickEdit Core provides comprehensive capabilities to color the text in the editor window. For more information, see Colors, Color Coding, and Symbol Colors.

Current Line

SlickEdit Core provides two ways to highlight the current line:

  • Draw a box around the current line - You can enable the Current line highlight for all languages. This draws a box around the current line. You can specify what type of box to use: a plain box, a tabs ruler, a syntax indent ruler, or a decimal ruler. You can also control the color of the box and column markers when using a ruler. To enable the current line highlight and specify options, open the Options dialog (Window → SlickEdit Preferences), expand Appearance and select General, then modify the options under the Current line highlight category.

  • Change the background and foreground color - On a language-specific basis, you can enable a different background and foreground color for the current line. From the main menu, select Window → SlickEdit Preferences → Languages, expand your language category and language, then select View. Put a check in Current line. To select the colors for the foreground and background, select Window → SlickEdit Preferences → Appearance → Colors, then select Current Line under the Selections node. For more information on setting colors. see Colors.

    Note

    Depending on the background color you select, SlickEdit Core will still use the foreground colors you have selected for other color coding elements, like strings, comments, etc. If the color you select for the background would make those colors too hard to read, SlickEdit Core will apply the foreground color selected for the Current line element.

Modified Lines

You can mark lines that have been modified or inserted during the current editing session. This will display a color indicator in the left margin of editor windows for each changed line. To enable this feature, select Window → SlickEdit Preferences → Languages then expand your language category and select the language you are configuring. Select the View options and put a check in Modified lines. To select the colors to use, select Window → SlickEdit Preferences → Appearance → Colors, then select Modified Line or Inserted Line under the Modifications node. For more information about setting colors, see Colors.

SlickEdit Core can clear the modified and inserted line color when you save a file. To activate this feature, from the main menu, click Window → SlickEdit Preferences, expand File Options and select the Save node. Then set the Reset modified lines option to True.

Tip

To show the modified lines on demand, bind the command color_modified_toggle to a key. It will toggle display of modified lines in a different color on/off. You can bind the color_toggle command to a key as well. This command toggles between current line, modified line, and language specific coloring individually.

Viewing Special Characters

By default, many important characters are not visible in the editor, like tabs, spaces, and newline characters. When you enable view of these special characters, SlickEdit® Core displays a visible character to represent the invisible characters.

You can enable view of special characters on a per-document or language-specific basis:

  • For the current document - From the main menu, click Display → Special Chars, or use the view_specialchars_toggle command. This toggles the display of all special characters (tabs, spaces, and newline characters) on and off. The menu also provides options to toggle display of these characters individually.

  • For a specific language - Using the Options dialog (Window → SlickEdit Preferences), expand the Languages node and your language, then select View. Select the option Special Characters. This enables the display of all special characters for the chosen language. Alternately, you can select to enable display of the characters individually.

To define the characters that are displayed to represent the special characters, see Defining Special Characters. To define the colors that are used for special characters, see Changing the Color of Special Characters.

Note

  • Viewing special characters is only available for ASCII files.

  • When the display of special characters is enabled along with Display → Line Hex, the hex value for the actual character (like space) will be displayed, not the value for the character used to represent it (like a dot).

Defining Special Characters

To define the characters that are displayed to represent the special characters, from the main menu, click Window → SlickEdit Preferences, expand Appearance and select Special Characters. Enter the character codes that you wish to use.

To view the differences between a DOS format text file and another format when Display → New Line Chars is active, choose something other than a space for the End-Of-Line (2) character. Under Windows, the recommended choices are 13 for End-Of-Line (1) and 10 for End-Of-Line (2).

Changing the Color of Special Characters

To change the colors and styles of special characters, use the Color options screen (Window → SlickEdit Preferences → Appearance → Colors). Select Special Characters from the screen element drop-down list. For more information on color settings, see Colors, Color Coding, and Symbol Colors.

Viewing Line Numbers

The current line number is always displayed in the editor's status line. Click on the line number indicator to display the Go to Line dialog. This shows the total number of lines and allows you to navigate to a specific line.

Line numbers can be displayed in the left margin area. You can enable them for a single document, a single language,or for all languages:

  • For the current document - From the main menu, click Display → Line Numbers, or use the view_line_numbers_toggle command. This toggles the display of line numbers on and off.

  • For a specific language - Using the Options dialog (Window → SlickEdit Preferences), expand the Languages node and your language, then select View. Select the option Line numbers.

  • For all languages - From the main menu, select Tools → Quick Start Configuration. The Coding screen allows you to turn on line numbers for all languages.

You can select options that control the width of the line numbers. For more information see Language-Specific View Options.

Tip

  • To control whether a colon is displayed with line numbers, use the line_numbers_show_colon command. At the command line prompt, type Y (for yes) or N (for no).

  • To change the amount of space used in the left margin of editor windows for line numbers, use the line_numbers_set_width command. At the command line prompt, enter the number of the desired width, in pixels.

  • To change the color of line numbers, select Window → SlickEdit Preferences → Appearance → Colors node in the Options dialog, and select the Line Number screen element.

Soft Wrap

Soft Wrap makes it easy to view long lines of code without scrolling. When Soft Wrap is enabled, each line is wrapped as though a carriage return was inserted; however, unlike Word Wrap, the file itself is not modified.

You can enable Soft Wrap on a per-document or language-specific basis:

  • For the current document - From the main menu, click Display → Soft Wrap, or use the softwrap_toggle command. This toggles Soft Wrap on and off.

  • For a specific language - Using the Options dialog (Window → SlickEdit Preferences), expand the Languages node and your language, then select Word Wrap. Select the option Wrap long lines to window width. Options are also available here to break the text at the end of a word so that words are kept whole (Break on word boundary), and to enable Soft Wrap for all languages so you don't have to configure each one (Enable soft wrap).

When Soft Wrap is on, arrows in the right margin indicate lines that are wrapped. The following screen shows Soft Wrap enabled in an XML document:

For related information, see Word Wrap, Comment Wrap, and Reflowing Text.

Selective Display

Selective Display (also known as code folding) is a convenient way to display or hide regions of your code, so that you can view those regions that are relevant to your current editing session.

Use the Selective Display dialog to activate this feature and to specify the type of regions to display or hide. This dialog is displayed by clicking Display → Selective Display, or by using the selective_display command. For more information, see View Dialogs and Views. For a description of additional menu entries for Selective Dispaly, see View Menu.

When Selective Display is active, a Plus (+) or Minus (-) bitmap is placed before hidden or expanded lines in the editor window margin. The following screen shot shows a sample file with two function definitions expanded and the rest collapsed.

When Selective Display is active, you can perform the following operations:

  • Display or hide lines - Double-click on the Plus (+) or Minus (-) bitmaps. Alternatively, click Display → Expand/Collapse Block, press Ctrl+\, or use the plusminus command. See Expanding/Collapsing Code Blocks for more details.

  • Copy visible text to the clipboard - Click Display → Copy Visible or use the copy_selective_display command. Normally when you copy a selection that spans multiple lines, hidden lines are copied as well. This command ignores hidden lines and only copies visible text. This operation does not work with block selections.

  • Redisplay all lines and remove the bitmaps - From the main menu click Display → Show All(show_all command).

To define the type of information to show/hide, see Selective Display Regions.

Expanding/Collapsing Code Blocks

SlickEdit® Core provides a more keyboard-centric way to expand and collapse code blocks. You can expand or collapse blocks of code by using the plusminus command, whether or not Selective Display Plus or Minus bitmaps are displayed.

The plusminus command expands or collapses code blocks under the following conditions:

  • If the cursor is on the first line of a code block, the block is collapsed, creating a new Selective Display region.

  • If the cursor is on a line that contains a Plus (+) bitmap, the block is expanded.

  • If the cursor is on a line that contains a Minus (-) bitmap, the expanded block is collapsed.

Note

  • The definition of a "code block" is based on your language.

  • Selective Display bitmaps can be expanded or collapsed with a single click, causing Selective Display to operate similar to Windows Explorer. Note, however, that you will not be able to select a line by clicking to the left of a text line which contains a Selective Display bitmap. To set this option, from the main menu, click Window → SlickEdit Preferences → Appearance → Advanced, then set the value of Expand/collapse to Expand on single click.

  • The plusminus command is controlled by the def_plusminus_blocks configuration variable. The value is set to true (1) by default. For more information, see Configuration Variables.

  • The plusminus command uses the same logic to identify code blocks as the command cut_code_block. See Deleting Code Blocks for more information.

Selective Display Regions

Using the Selective Display dialog, you can choose the regions you want to display or hide. Specific settings are provided for each region.

  • Selective Display View - Displays lines that contain the specified search string or lines that do not contain the specified string.

  • Function Headers - Displays only function headings and optionally, function heading comments.

  • Preprocessor Directives - Displays a source file as if it were preprocessed according to the define values specified here. If you do not remember your defines, use the Scan for Defines button.

  • Multi-Level - Select this option to set multiple levels of Selective Display based on braces or indent.

  • Paragraphs - Displays the first line of each paragraph. A paragraph is defined by a group of lines followed by one or more blank lines.

  • Hide Selection - Select this option to hide the lines in the current selection.

The Selective Display dialog also contains static options for expanding/collapsing sub-levels. See View Dialogs and Views for more information and details about the available settings.

Hex/Line Hex View

SlickEdit® Core supports hex/line hex viewing and editing on a per-document or per-language basis.

Hex view displays your code using hexadecimal values to represent each character. The ASCII representation is also shown on the right side of the editor window. When you position the cursor in one representation, the corresponding location in the other is highlighted. You can edit by changing the hex values or by changing the ASCII characters.

Line hex preserves your code layout, formatting, and color coding. It shows the hexadecimal value for each character below the corresponding character. Since two hex digits are needed, the value is displayed in a column below the corresponding character with the most significant digit at the top. This makes it easier to read your code and still see the hex values for each character. As with regular hex view, you can edit either the ASCII representation or the hexadecimal values.

See also Hex Mode Editing for more information.

Other Display Options

This section describes other general display options that you might find useful.

Displaying a Vertical Line

You can choose to display a vertical line in all files that are open for editing. To access this setting, from the main menu, click Window → SlickEdit Preferences, expand Appearance and select General, then in the Vertical line column spin box, specify the column number at which you want the vertical line displayed. A value of 0 (default) displays no vertical line. Click on the Vertical line color option to change the color of the vertical line.