TextEditor.Highlight (gb.form.editor)

Property Highlight As String

Return or set the highlighting mode.

It can take one of the following values: "c", "c++" or "cplusplus", "css", "custom", "diff", "gambas", "html", "none", "javascript", "sh", "sql", "webpage".

If the highlighting mode is set to "custom", "none" or a null string, then the Highlight event will be raised each time a line must be highlighted. If you do not implement the handler for that event, nothing will be highlighted.

The property is NULL by default.

The data required is the lowerclass name of the highlighting syntax, not one of the Highlight class constants.

Example

Dim TextEditor1 as TextEditor

TextEditor1.Highlight = "gambas"

Be extra careful when setting the highlight mode to "gambas" on non-gambas text files.

For example. If you create a text editor that can select different Highlight modes.

All other highlight choices will just "show" the text a certain way depending on the style.

But selecting "gambas" as a "Highlight" will actually re-format your entire document text making it gambas compliant like it's a gambas source code file.

It does not just change the way you see it.

This could be disastrous on a large bash script.

(Note. This has been addressed in the latest Gambas 3.15.90 beta so is only relevant on previous versions)