The UltraEdit versions prior v9.00 support up to 10 syntax highlighting languages per wordfile.
UltraEdit v9.00 to v14.20 and all versions of UEStudio up to v9.00 support up to 20 languages
per wordfile. (Later versions of UltraEdit and UEStudio support also up to 20 languages in a
single wordfile, but these versions use by default a wordfiles directory.) These versions save the
color and font style settings in the INI file or registry.
Here is an example of the settings
for the first syntax highlighting language in the INI file with the defaults of UltraEdit.
[Language 1 Colors]
Colors=0,8421376,8421376,8421504,255,16711680,255,33023,32768,4210816,16711680,16711680,16711680,
Colors Auto Back=1,1,1,1,1,1,1,1,1,1,1,1,1,
Colors Back=16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,
Font Style=0,0,0,0,0,0,0,0,0,0,0,0,0,
The first line Colors= contains the decimal values of the colors for the 13 color groups:
The values can be calculated with following formula:
Color value = value of blue * 65536 + value of green * 256 + value of red
The values are maybe easier to read after converting them to hexadecimal. For example the decimal value 8404992 is hexadecimal 804000. The first character pair of the hex value is the value of blue, the second is for green and the third one for red. Please note that the color values in CSS files or CSS sections are in reverse order: red, blue and green. The maximum value is 16777215 (FFFFFF) which is the value of white. However, the colors can be specified easily in the syntax highlighting configuration dialog. There is really no need to calculate the values manually.
The second line Colors Auto Back= contains the state of the setting Background Color Automatic for the 13 color groups. The values can be only 0 or 1. The default value of 1 means that the background color for this color group is the same as specified for example at View - Set Colors for normal text background. A value of 0 for a color group enables the special background color setting for this color group.
The third line Colors Back= contains the decimal color values of the background colors for the 13 color groups. A color value in this line gets active only when the corresponding value in the line above is 0.
The fourth line Font Style= contains the font style settings for the color groups. The possible values are:
The first value for color group Normal Text is ignored and is always 0. When using bold, italic or underline the font used should be a fixed pitch font. A fixed pitch font is a font with same width for a letter in all styles. So for example a normal E has the same width as a bold E, an italic E and an underlined E. If the font is additionally also a mono-spaced font - all characters have the same width - or a proportional font - each character has an individual width - is not so important when using the font styles for syntax highlighting.
Here is an example how the settings above are stored in the registry:
[HKEY_CURRENT_USER\Software\IDM Computer Solutions\UltraEdit\Language 1 Colors]
"Colors"="0,8421376,8421376,8421504,255,16711680,255,33023,32768,4210816,16711680,16711680,16711680,"
"Colors Back"="16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,"
"Colors Auto Back"="1,1,1,1,1,1,1,1,1,1,1,1,1,"
"Font Style"="0,0,0,0,0,0,0,0,0,0,0,0,0,"
With UltraEdit v15.00 and UEStudio v9.10 the organization of syntax highlighting languages
has been changed. Instead of using only 1 wordfile with up to 20 languages the default for
new installations is now that UE/UES searches in a configured directory for wordfiles (*.uew) which
contain normally only 1 language, but can contain also several languages. The language number
is not important any more and there is no limit for the number of languages any more. But for downwards
compatibility a single wordfile instead of a wordfiles directory is used further after an upgrade from
a previous version.
Because of this new management the color and font style settings of the languages are not stored any more in the INI file or registry. They are now stored in the wordfile itself for every language. The settings are stored in the wordfile(s) as follows:
/Colors = 0,8421376,8421376,8421504,255
/Colors Back = 16777215,16777215,16777215,16777215,16777215,
/Colors Auto Back = 1,1,1,1,1,
/Font Style = 0,0,0,0,0,
/C1 Colors = 16711680 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0
/C2 Colors = 255 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0
/C3 Colors = 33023 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0
/C4 Colors = 32768 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0
/C5 Colors = 4210816 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0
/C6 Colors = 16711680 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0
/C7 Colors = 16711680 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0
/C8 Colors = 16711680 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0
The first four lines with the settings for the standard color groups Normal Text, Comments, Alternate Block Comments, Strings and Numbers are stored in the wordfile below the language definition line.
The settings for the color groups with the word lists are appended to the color group definition lines starting with /C1 - /C8 followed normally by the group name in double quotes and optionally by a style keyword for the IntelliTip feature of UEStudio. With UltraEdit v17.00 and UEStudio v11.00 the number of color groups increased from 8 to 20. Therefore wordfiles for UltraEdit v17.00 or UEStudio v11.00 or any later version can contain also color groups /C9 - /C20.
Note: It is required that before and after every equal sign exactly 1 space character exists. And the names of the settings are case sensitive.
On first start after an upgrade from a previous version the language settings are copied from the INI or registry into the wordfile and saved on exit in the wordfile. Every [Language x Colors] section once copied into a wordfile is automatically completely removed from the INI or registry. So normally after first start (more precisely exit) of UE/UES after an upgrade the INI or registry contains only the language color sections of languages not found in the wordfile. Those color sections can be deleted manually from the INI or registry.
UltraEdit v15.00 or UEStudio v9.10 and later are installed with standard wordfiles (*.uew) in a subdirectory named wordfiles in the program directory of UE/UES. These wordfiles contain no color and font style settings. On start of UE/UES the whole wordfiles directory is copied to "%appdata%\IDMComp\UltraEdit\" respectively "%appdata%\IDMComp\UEStudio\" if such a directory does not already exist. This directory is also set as wordfiles directory in the INI file or registry. A different directory can be specified in the syntax highlighting configuration dialog.
The procedure as written above is also executed when upgrading from UltraEdit prior v15.00 or UEStudio prior v9.10 with one exception: the path to the wordfile in the INI file or registry is not modified and the wordfile from the previous version is used further.
ATTENTION!
The macros are not working correct when the setting Automatically copy to clipboard when selection is made at Configuration - Editor - Miscellaneous is enabled. Uncheck this setting before running any macro. And also disable word-wrap mode if word-wrap is enabled for the wordfile or by default for new (temporary) files.
If you find any bugs or have other related questions, post it at
http://www.ultraedit.com/forums/viewtopic.php?t=443.
Maybe you are a user who upgraded from a previous version and you want to use now also several wordfiles in a wordfiles directory instead of 1 wordfile with several languages. In this case the macro SplitToWordfiles is for you. It is very easy to use.
How to use SplitToWordfiles?
The opposite of SplitToWordfiles is the macro WordfilesMerger. This macro can be useful for all UE/UES users independent of the version they use. It is mainly written to merge the contents of several wordfiles into one wordfile. But it does not only copy the contents of all open wordfiles into a new file. It also renumbers the languages by keeping the existing language number as much as possible. And all languages with language number 20 get automatically the next free language number. And in the last step the macro re-orders the syntax highlighting languages.
So the macro WordfilesMerger can be used with a single wordfile open just for re-ordering the languages in this wordfile (done in a new file).
It can be used to append a downloaded wordfile to an existing wordfile with 1 or more languages as explained in the power tip Adding a wordfile in UltraEdit pre v15.00 or in the Readme for the Syntax Highlighting forum a little bit more comfortable.
Or it is used for example to create a project specific wordfile by opening all wordfiles required for a project and running this macro.
How to use WordfilesMerger?
You are using UltraEdit v15.00 or UEStudio v9.10 or any later and you want to publish a wordfile you have created for example by sending it by email to IDM for their download area. Or you want to give your wordfile(s) somebody else which uses a different color scheme than you. In this case the macro SettingsDelAll should be used. It deletes all the color and font style settings from the wordfile currently open and active.
How to use SettingsDelAll?
The macro SettingsDelCur is similar SettingsDelAll. It also removes all color and font style settings, but only for the language the caret is currently set instead of the entire wordfile. If a wordfile contains only one language, it makes no difference which macro is executed: SettingsDelAll or SettingsDelCur, except SettingsDelAll is much faster. SettingsDelCur is used also by the macro SettingsCopyCur explained later in this document.
How to use SettingsDelCur?
In UltraEdit prior v15.00 and UEStudio prior v9.10 the color scheme of a syntax highlighting language was stored as a section in the INI file or registry. Therefore it was quite simple to apply a preferred color scheme to all languages by simply replicating the block for every language. Also copying a color scheme into a new file and give this file to somebody else which want the color scheme too was no problem.
Now with the color scheme saved individually in the wordfile it is possible to share or distribute more easily the wordfile of a syntax highlighting language together with the color and font style settings. That is great for example for a team working on a project where the members want to use all the same color scheme too.
But with the color scheme saved in the wordfile it is not so easy any more to apply a preferred language color scheme to a wordfile got from a team member, colleague or friend, or downloaded for example from Downloads - Wordfiles. It is also more difficult to share with somebody else only the language color scheme.
The macros SettingsCopyAll, SettingsCopyCur and SettingsExtract are written to help you to manage the language color settings in wordfiles of UltraEdit v15.00 or UEStudio v9.10 or any later.
The macro SettingsExtract copies the color and font style settings
of one language in the wordfile into a new file which can be saved for example with the extension
uesh. This file can be used later by yourself for new wordfiles or
to share the language color scheme with somebody else.
How to use SettingsExtract?
The macro SettingsCopyAll copies the color and font style settings in the wordfile format for example from a *.uesh file created before by you or somebody else with the macro SettingsExtract to all languages in a wordfile. It is also possible to use another wordfile as color scheme source instead of a file containing only the color scheme. But it is recommended to use a syntax highlighting color scheme file as source file. With this macro you can easily apply your preferred language color scheme to all languages in a wordfile, or when you run it multiple times, to all wordfiles you use. It does not matter if the wordfile contains already color settings or not. Existing color settings are automatically completely deleted before copying the new color settings to all languages in the wordfile.
How to use SettingsCopyAll?
The macro SettingsCopyCur is similar SettingsCopyAll. The difference is that the color settings are copied only to the language the caret is currently set instead of all languages in the entire wordfile. If a wordfile contains only one language, it makes no difference which macro is executed: SettingsCopyAll or SettingsCopyCur, except SettingsCopyAll is faster. Existing color settings for the current language are automatically completely deleted by playing macro SettingsDelCur before copying the new color settings to the current language in the wordfile.
How to use SettingsCopyCur?
But what to do when you upgraded from a previous version of UltraEdit or UEStudio and UE/UES has not copied the color and font style settings into your wordfile or you lost the settings in the wordfile(s)? If you still have a copy of the INI file containing the sections with the language colors and font style settings you have luck because you can use the macro SettingsCopyIni to copy the settings from the INI file into the wordfile(s). Please note that this macro supports only up to 8 color groups while all others support up to 20 color groups because more colors are not stored in the INI file.
How to use SettingsCopyIni?
THIS MACRO SET IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO USE, RESULTS AND PERFORMANCE OF THE MACRO SET IS ASSUMED BY YOU AND IF THE MACRO SET SHOULD PROVE TO BE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR OTHER REMEDIATION. UNDER NO CIRCUMSTANCES, CAN THE AUTHOR BE HELD RESPONSIBLE FOR ANY DAMAGE CAUSED IN ANY USUAL, SPECIAL, OR ACCIDENTAL WAY OR BY THE MACRO SET.