AdvMemo matching open and close brackects


I inherited a new class from TAdvMemo to add few new things.
I would like to find a pair of opening/closing symbols / (), [], {}, <> / in the text (row and column) and highlight the opening and closing brackects. Is there a built in solution already?

For me, also would be good if I can find the pair character ignore coments and strings.

Thanks any advice.

The definitions for where such code block starts and ends is in the Styler component under Styler.BlockStart, Styler.BlockEnd.
You can add multiple comma-separated values.
When the caret is in a code block, the code block start & end are indicated with background color AdvMemo.BlockColor

Yes, I knew this feature but it is not so fully good for me.

For example, if we use Pascal styler and BlockStart is "begin,[" and BlockEnd is "end,]" and the text in the Memo:

procedure A;

Unfortunately, the function is not working at all. Maybe [,] characters cannot be blockstart and blockend.

Additionally, if AutoBlockEnd is true then memo will insert the "end,]" text as block end. It seems that memo component does not handle well if there is more than one BlockEnd elements.

Additionally it is needed to work weel within one line also. So, I think I shall do own implementation for this. Thanks.

Is there any function which result of position (based CurX and CurY) style?

At this moment, there is not a public method to get the style at CurX, CurY.
This is a good suggestion though we will consider.

We have seen an conflict because characters as [ and ] are considered symbols and treated different. We'll investigate if we can make this not conflicting in a future update.

Does it mean that there is protected or private method?

Not directly.
Internally it first gets the style at start of line and then processes from there but it isn't exposing the style at a specific X position.

OK. Thanks the answer.

I'm only asking because of our planning and by no means an urgency.
What do you think when this feature will be available (if you accept this feature idea)? Few weeks, months maybe?

If you implemented it please inform me.

Thank you.

Earliest timeframe to start working on this will be 2nd half of May.


sorry for question again. Do you have any new information about this. Thanks.

The best we can expose for now is the style at the beginning of a given line.
To get this at a specific cursor X position requires some more non-trivial work.