Highlighting provide a way of coloring certain bytes or shorts in a file for identification (a short is a group of two hex bytes). For example, with highlighting all of the bytes with values 128 to 255 could be colored to identify non-ASCII bytes. The Highlight Options dialog can be accessed by clicking the 'Tools > Options...' menu option and selecting Highlights from the list, or clicking 'View > Highlighting > Edit Highlights...'. Highlights can be turned on or off by clicking on them in the 'View > Highlighting' menu. The enabled highlights are associated with a File Interface (see Working with File Interfaces for more information).
All available highlights are displayed in a list at the top of the dialog. Click New to generate a new highlight, or select an item in the list and click Delete to remove the highlight. Clicking the up or down arrows will change the selected item's position in the list.
When a highlight is selected from the list, its details will be displayed in the Highlight Options box. The name entered in the Name field will appear on any menu where the highlight will be accessed. If the Visible toggle is turned off, the highlight rule will not appear on any menus. If the Method drop-down list indicates Highlight Bytes, the Ranges field contains which byte values will be highlighted by this rule (values range from 0 to 255). Enter a value in any of the available numeric formats (see Introduction to Number Systems). Multiple values can be separated by the ',' character, or a range of values can be specified using '..'. For example, '0..31,127' will highlight bytes 0 to 31 inclusive, and 127. If the Method drop-down list specifies Highlight Shorts, enter the range of Shorts to highlight in the Ranges field (values range from 0 to 65535). Note that a Short is a group of two hex bytes in a file and how the Shorts are interpreted depends upon the current Endian of the file. Use the Highlight Shorts method when applying coloring rules to Unicode files.
The bytes in the current file that match this highlight rule will be colored. If the Use Default Highlight Color toggle is enabled, the bytes are colored according to the Highlighting color in the Theme/Color Options dialog. If the Custom Color toggle is enabled, the bytes are colored according to the Fore and Back color boxes. Using custom colors, multiple highlights can be turned on at the same time using different colors.
The following Highlight rules are available by default:
- Linefeed Characters - 0x0d and 0x0a
- Alphanumeric Characters - all letters and numbers
- Control Characters - any of the bytes from 0 to 31 and byte 127
- Non-ASCII Characters - any of the bytes from 128 to 255
Click the Reset button to restore all Highlight rules to their original values.