Built-in backet highlighting #34
Pinned
pyscripter
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The feature has been implemented using indicators, which makes more efficient than painting in the PaintTransient handler. It also eliminates flicker.
A new option
eoBracketsHighlight
, included in the default options, enables this feature.SynEdit has a new public (not published) property
property BracketsHighlight: TSynBracketsHighlight read FBracketsHighlight;
TSynBracketsHighlight is defined in SynEditMiscClasses as
By default the bluish $FF8800 is used for the balanced parenthesis painting and red for the unbalanced parenthesis. The FontStyle is set to [fsBold]. You can use the Set methods to change these colors and Font style.
TSynCustomHighlighter also got a new published property Brackets, which is used in relation to this feature. It also has a protected DefaultBrackets property, which is used to in TSynCustomHighlighter.IsBracketsStored. Both are initialized to '{}[]{}'. The Brackets property is also used by TCustomSynEdit.GetMatchingBracket. Derived highlighter can overwrite these values to more suitable defaults.
Advanced notes
More complex delimiter highlighting (such as begin end) can be achieved in a manner similar to the implementation of this feature. You can handle the OnStatusChange and OnChange events to add suitable indicators to the keywords.
Beta Was this translation helpful? Give feedback.
All reactions