Syntax Coloring

Index of All Documentation » Wing Pro Reference Manual » Customization »

There are two ways to configure syntax highlighting in Wing: Minor adjustments can be made in preferences, and comprehensive configuration can be achieved by creating a syntax color specification file.

Minor Adjustments

For minor tweaks to syntax coloring in the editor, use Syntax Formatting in the Edit > Syntax Coloring preference group. For each supported file type, and each lexical state for the file type, it is possible to set the foreground and background colors, to use bold or italic font, and to fill the end of line character so it appears as a solid block of color.

Comprehensive Changes

For more comprehensive changes to syntax coloring, textual syntax coloring specifications can be placed into the syntax directory within the User Settings Directory. This directory must be created if it is not already present.

To override syntax colors only for a particular Color Palette, place the syntax file in a sub-directory of the syntax directory whose name matches the palette specification file name. For example, use syntax/black-background/python.stx to specify colors to use in Python files only with the Black Background color palette.

To override syntax colors for printing only, place the syntax file in a print sub-directory of the syntax directory. For example, use syntax/print/python.stx to specify colors to use in Python files when printing.

The syntax coloring configuration files can be modeled on the system-wide defaults, which are stored in resources/syntax within install directory listed in Wing's About box. Any values missing from these files cause Wing to fall back to the system-wide defaults. Wing must be restarted to pick up changes made in these files.

Note that any non-default syntax coloring preferences will take precedence over syntax files found in the user settings directory or system-wide.

Automatic Color Adjustment

If the currently selected Color Palette uses a non-white background for the editor, or if the Background Color in the Editor > Syntax Coloring preference group is set to a color other than white, then Wing will automatically adjust all configured foreground colors when necessary to ensure that the text remains visible. This avoids the need to create completely new color configurations for different editor background colors.

This feature is disabled when using a palette-specific syntax configuration file, as describe above, since in that case the colors are being designed for a specific background color.